Merge pull request #52 from limbonaut/fix-hsm-update-crash

Fix crashing on HSM update with state transition
This commit is contained in:
Serhii Snitsaruk 2024-02-26 22:29:09 +01:00 committed by GitHub
commit c7a4988e6c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 2 deletions

View File

@ -87,10 +87,13 @@ void LimboHSM::_exit() {
void LimboHSM::_update(double p_delta) {
if (active) {
ERR_FAIL_COND(active_state == nullptr);
ERR_FAIL_NULL(active_state);
LimboState *last_active_state = active_state;
LimboState::_update(p_delta);
if (last_active_state == active_state) {
active_state->_update(p_delta);
}
}
}
void LimboHSM::update(double p_delta) {