aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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