fix: state machine only acts if enabled

This commit is contained in:
Sara Gerretsen 2025-10-25 13:21:55 +02:00
parent e303c853e9
commit 71bd8cd630

View file

@ -19,7 +19,7 @@ void StateMachine::switch_to_state(State *state) {
}
void StateMachine::process(double delta) {
if (this->current_state) {
if (this->current_state && is_enabled()) {
this->current_state->process(delta);
String new_state{ this->current_state->get_next_state() };
if (new_state != this->current_state->get_class()) {