diff --git a/limbo_state.cpp b/limbo_state.cpp index 12d4968..c885f59 100644 --- a/limbo_state.cpp +++ b/limbo_state.cpp @@ -100,22 +100,19 @@ void LimboState::add_event_handler(const String &p_event, const Callable &p_hand handlers.insert(p_event, p_handler); } -LimboState *LimboState::call_on_enter(Object *p_object, const Callable &p_callable) { - ERR_FAIL_COND_V(p_object == nullptr, this); +LimboState *LimboState::call_on_enter(const Callable &p_callable) { ERR_FAIL_COND_V(!p_callable.is_valid(), this); connect(LimboStringNames::get_singleton()->entered, p_callable); return this; } -LimboState *LimboState::call_on_exit(Object *p_object, const Callable &p_callable) { - ERR_FAIL_COND_V(p_object == nullptr, this); +LimboState *LimboState::call_on_exit(const Callable &p_callable) { ERR_FAIL_COND_V(!p_callable.is_valid(), this); connect(LimboStringNames::get_singleton()->exited, p_callable); return this; } -LimboState *LimboState::call_on_update(Object *p_object, const Callable &p_callable) { - ERR_FAIL_COND_V(p_object == nullptr, this); +LimboState *LimboState::call_on_update(const Callable &p_callable) { ERR_FAIL_COND_V(!p_callable.is_valid(), this); connect(LimboStringNames::get_singleton()->updated, p_callable); return this; diff --git a/limbo_state.h b/limbo_state.h index 27b836a..40e665b 100644 --- a/limbo_state.h +++ b/limbo_state.h @@ -62,9 +62,9 @@ public: virtual bool dispatch(const String &p_event, const Variant &p_cargo); LimboState *named(String p_name); - LimboState *call_on_enter(Object *p_object, const Callable &p_callable); - LimboState *call_on_exit(Object *p_object, const Callable &p_callable); - LimboState *call_on_update(Object *p_object, const Callable &p_callable); + LimboState *call_on_enter(const Callable &p_callable); + LimboState *call_on_exit(const Callable &p_callable); + LimboState *call_on_update(const Callable &p_callable); _FORCE_INLINE_ String event_finished() const { return EVENT_FINISHED; } LimboState *get_root() const;