diff --git a/hsm/limbo_hsm.h b/hsm/limbo_hsm.h index f51eafa..d0f7585 100644 --- a/hsm/limbo_hsm.h +++ b/hsm/limbo_hsm.h @@ -16,6 +16,7 @@ #include "core/object/object.h" #include "core/templates/hash_map.h" +#include "core/variant/variant.h" class LimboHSM : public LimboState { GDCLASS(LimboHSM, LimboState); @@ -64,7 +65,7 @@ public: LimboState *get_initial_state() const { return initial_state; } virtual void initialize(Node *p_agent, const Ref &p_parent_scope = nullptr); - virtual bool dispatch(const String &p_event, const Variant &p_cargo) override; + virtual bool dispatch(const String &p_event, const Variant &p_cargo = Variant()) override; void update(double p_delta) { _update(p_delta); } void add_transition(Node *p_from_state, Node *p_to_state, const String &p_event); diff --git a/hsm/limbo_state.h b/hsm/limbo_state.h index 1e12201..841bb7f 100644 --- a/hsm/limbo_state.h +++ b/hsm/limbo_state.h @@ -69,7 +69,7 @@ public: Node *get_agent() const { return agent; } void set_agent(Node *p_agent) { agent = p_agent; } - virtual bool dispatch(const String &p_event, const Variant &p_cargo); + virtual bool dispatch(const String &p_event, const Variant &p_cargo = Variant()); LimboState *named(String p_name); LimboState *call_on_enter(const Callable &p_callable);