Skip to content

Commit

Permalink
Disallow LimboHSM transitions to self when ANYSTATE is used
Browse files Browse the repository at this point in the history
Resolves #29
  • Loading branch information
limbonaut committed Feb 7, 2024
1 parent 449538d commit 22c472f
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 22c472f

Please sign in to comment.