Skip to content

Commit

Permalink
Merge pull request #31 from limbonaut/fix-transitions-to-self
Browse files Browse the repository at this point in the history
Disallow LimboHSM transitions to self when ANYSTATE is used
  • Loading branch information
limbonaut authored Feb 7, 2024
2 parents 8260954 + 22c472f commit fca8aea
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions hsm/limbo_hsm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ bool LimboHSM::dispatch(const String &p_event, const Variant &p_cargo) {
key = _get_transition_key(nullptr, p_event);
if (transitions.has(key)) {
to_state = transitions[key];
if (to_state == active_state) {
// Transitions to self are not allowed with ANYSTATE.
to_state = nullptr;
}
}
}
if (to_state != nullptr) {
Expand Down

0 comments on commit fca8aea

Please sign in to comment.