Fix AnimationNodeStateMachinePlayback start() on nonexistent node

(cherry picked from commit b6e7df56cb)
This commit is contained in:
Florian Kothmeier 2021-01-05 15:56:06 +01:00 committed by Rémi Verschelde
parent 761c915070
commit 5185cd4f80
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -327,11 +327,17 @@ float AnimationNodeStateMachinePlayback::process(AnimationNodeStateMachine *p_st
}
} else {
// teleport to start
path.clear();
current = start_request;
playing = true;
play_start = true;
start_request = StringName(); //clear start request
if (p_state_machine->states.has(start_request)) {
path.clear();
current = start_request;
playing = true;
play_start = true;
start_request = StringName(); //clear start request
} else {
StringName node = start_request;
start_request = StringName(); //clear start request
ERR_FAIL_V_MSG(0, "No such node: '" + node + "'");
}
}
}