Core/Scripts: Make CreatureAI::DoZoneInCombat overload accepting a different creature static

This commit is contained in:
Shauren
2023-03-11 13:37:03 +01:00
parent 4300c3edd3
commit 080bf4c565
2 changed files with 5 additions and 5 deletions

View File

@@ -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
{

View File

@@ -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