Merge pull request #52 from limbonaut/fix-hsm-update-crash
Fix crashing on HSM update with state transition
This commit is contained in:
commit
c7a4988e6c
|
@ -87,11 +87,14 @@ void LimboHSM::_exit() {
|
||||||
|
|
||||||
void LimboHSM::_update(double p_delta) {
|
void LimboHSM::_update(double p_delta) {
|
||||||
if (active) {
|
if (active) {
|
||||||
ERR_FAIL_COND(active_state == nullptr);
|
ERR_FAIL_NULL(active_state);
|
||||||
|
LimboState *last_active_state = active_state;
|
||||||
LimboState::_update(p_delta);
|
LimboState::_update(p_delta);
|
||||||
|
if (last_active_state == active_state) {
|
||||||
active_state->_update(p_delta);
|
active_state->_update(p_delta);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void LimboHSM::update(double p_delta) {
|
void LimboHSM::update(double p_delta) {
|
||||||
_update(p_delta);
|
_update(p_delta);
|
||||||
|
|
Loading…
Reference in New Issue