fix: force transition no longer restarts same state

This commit is contained in:
CarlWachter 2024-09-02 09:28:24 +02:00 committed by carlwachter
parent 34c036b600
commit 0a155905ee

View File

@ -72,7 +72,8 @@ namespace sta
transition.event = EventFlags::NORMAL;
transition.lockout = lockout;
if (force){
// Force the transition if requested, but only if the requested state is different from the current one.
if (force && transition.to != currentState_){
// Perform the transition and notify the threads. The event flags are set
// here in order to allow threads to react immediately.
currentState_ = transition.to;