aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2023-03-11 13:37:03 +0100
committerShauren <shauren.trinity@gmail.com>2023-03-11 13:37:03 +0100
commit080bf4c5650d54694819f6aaf7a12f3cbc623ef4 (patch)
tree27531c22a6cb466a3d59424ac088f45921976737
parent4300c3edd3b2fe4c0f5a01807271e663b6750ebb (diff)
Core/Scripts: Make CreatureAI::DoZoneInCombat overload accepting a different creature static
-rw-r--r--src/server/game/AI/CreatureAI.cpp5
-rw-r--r--src/server/game/AI/CreatureAI.h5
2 files changed, 5 insertions, 5 deletions
diff --git a/src/server/game/AI/CreatureAI.cpp b/src/server/game/AI/CreatureAI.cpp
index 0ae258856a6..3f2aae8d2de 100644
--- a/src/server/game/AI/CreatureAI.cpp
+++ b/src/server/game/AI/CreatureAI.cpp
@@ -78,11 +78,8 @@ void CreatureAI::OnCharmed(bool isNew)
UnitAI::OnCharmed(isNew);
}
-void CreatureAI::DoZoneInCombat(Creature* creature /*= nullptr*/)
+void CreatureAI::DoZoneInCombat(Creature* creature)
{
- if (!creature)
- creature = me;
-
Map* map = creature->GetMap();
if (!map->IsDungeon()) // use IsDungeon instead of Instanceable, in case battlegrounds will be instantiated
{
diff --git a/src/server/game/AI/CreatureAI.h b/src/server/game/AI/CreatureAI.h
index a6c03467ca2..a36de96f8df 100644
--- a/src/server/game/AI/CreatureAI.h
+++ b/src/server/game/AI/CreatureAI.h
@@ -155,7 +155,8 @@ class TC_GAME_API CreatureAI : public UnitAI
// Called at reaching home after evade
virtual void JustReachedHome() { }
- void DoZoneInCombat(Creature* creature = nullptr);
+ void DoZoneInCombat() { DoZoneInCombat(me); }
+ static void DoZoneInCombat(Creature* creature);
// Called at text emote receive from player
virtual void ReceiveEmote(Player* /*player*/, uint32 /*emoteId*/) { }
@@ -251,6 +252,8 @@ class TC_GAME_API CreatureAI : public UnitAI
uint32 const _scriptId;
bool _isEngaged;
bool _moveInLOSLocked;
+
+ friend Scripting::v2::ScriptedAI;
};
#endif