From ca49ee81d7d4dc8ab5324b950ab6ec91f4ff557b Mon Sep 17 00:00:00 2001 From: Sara Date: Thu, 29 Jan 2026 15:19:15 +0100 Subject: [PATCH] feat: state machine exposes switch_to_state --- modules/wave_survival/state_machine.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/wave_survival/state_machine.cpp b/modules/wave_survival/state_machine.cpp index a54727a6..ece6bdae 100644 --- a/modules/wave_survival/state_machine.cpp +++ b/modules/wave_survival/state_machine.cpp @@ -2,7 +2,9 @@ #include "core/config/engine.h" #include "state.h" -void StateMachine::_bind_methods() {} +void StateMachine::_bind_methods() { + ClassDB::bind_method(D_METHOD("switch_to_state", "state"), &self_type::switch_to_state); +} void StateMachine::switch_to_state(State *state) { if (this->current_state != nullptr) { @@ -13,8 +15,6 @@ void StateMachine::switch_to_state(State *state) { if (this->current_state != nullptr) { this->current_state_is_active = true; this->current_state->enter_state(); - } else { - print_error("StateMachine::switch_to_state: New state is nullptr, StateMachine will now stop working"); } }