mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-03-06 20:38:44 -06:00
Prevent crash if a node was removed during path traversal (closes #1990)
Show an error message, because this is bad user behavior and should be discouraged :)
This commit is contained in:
@@ -205,6 +205,16 @@ void PathNavigator::updateCamera(double deltaTime) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!_currentPath->startPoint().node() || !_currentPath->endPoint().node()) {
|
||||
LERROR(
|
||||
"One of the scene graph nodes used in an active camera path "
|
||||
"was removed. Aborting path"
|
||||
);
|
||||
abortPath();
|
||||
global::navigationHandler->orbitalNavigator().setFocusNode("Root", false);
|
||||
return;
|
||||
}
|
||||
|
||||
// Prevent long delta times due to e.g. computations from other actions to cause
|
||||
// really big jumps in the motion along the path
|
||||
// OBS! Causes problems if the general FPS is lower than 10, but then the user should
|
||||
|
||||
Reference in New Issue
Block a user