refactor(Core/SmartScripts): Change invoker to be WorldObject (#19408)

* refactor(Core/SmartScripts): Change invoker to be WorldObject

* avoid dangling else

* womp womp

* check for null

* null check

* Update SmartScript.cpp

* Avarishd broke it for sure

* remove redundant check

* reduce more redundant code

* who doesnt love redundancy
This commit is contained in:
Kitzunu
2024-07-27 12:32:55 +02:00
committed by GitHub
parent e34ce755c8
commit 5da3e2e688
4 changed files with 85 additions and 36 deletions

View File

@@ -70,7 +70,7 @@ public:
void StopFollow(bool complete);
void MoveAway(float distance);
void SetScript9(SmartScriptHolder& e, uint32 entry, Unit* invoker);
void SetScript9(SmartScriptHolder& e, uint32 entry, WorldObject* invoker);
SmartScript* GetScript() { return &mScript; }
bool IsEscortInvokerInRange();
@@ -160,7 +160,7 @@ public:
// Used in scripts to share variables
void SetData(uint32 id, uint32 value) override { SetData(id, value, nullptr); }
void SetData(uint32 id, uint32 value, Unit* invoker);
void SetData(uint32 id, uint32 value, WorldObject* invoker);
// Used in scripts to share variables
void SetGUID(ObjectGuid guid, int32 id = 0) override;
@@ -274,8 +274,8 @@ public:
bool QuestReward(Player* player, Quest const* quest, uint32 opt) override;
void Destroyed(Player* player, uint32 eventId) override;
void SetData(uint32 id, uint32 value) override { SetData(id, value, nullptr); }
void SetData(uint32 id, uint32 value, Unit* invoker);
void SetScript9(SmartScriptHolder& e, uint32 entry, Unit* invoker);
void SetData(uint32 id, uint32 value, WorldObject* invoker);
void SetScript9(SmartScriptHolder& e, uint32 entry, WorldObject* invoker);
void OnGameEvent(bool start, uint16 eventId) override;
void OnStateChanged(uint32 state, Unit* unit) override;
void EventInform(uint32 eventId) override;