diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/AI/CreatureAI.cpp | 20 | ||||
-rw-r--r-- | src/server/game/AI/CreatureAI.h | 3 | ||||
-rw-r--r-- | src/server/game/Groups/Group.cpp | 6 |
3 files changed, 5 insertions, 24 deletions
diff --git a/src/server/game/AI/CreatureAI.cpp b/src/server/game/AI/CreatureAI.cpp index 47b0ba40812..1a468a4e8a1 100644 --- a/src/server/game/AI/CreatureAI.cpp +++ b/src/server/game/AI/CreatureAI.cpp @@ -36,9 +36,7 @@ AISpellInfoType* UnitAI::AISpellInfo; AISpellInfoType* GetAISpellInfo(uint32 i) { return &UnitAI::AISpellInfo[i]; } -CreatureAI::CreatureAI(Creature* creature) - : UnitAI(creature), me(creature), _boundary(nullptr), _negateBoundary(false), _moveInLOSLocked(false), - _wasEngaged(false) +CreatureAI::CreatureAI(Creature* creature) : UnitAI(creature), me(creature), _boundary(nullptr), _negateBoundary(false), _moveInLOSLocked(false) { } @@ -155,9 +153,6 @@ void CreatureAI::TriggerAlert(Unit const* who) const void CreatureAI::EnterEvadeMode(EvadeReason why) { - // Set the WasEngaged flag to false to ensure we don't evade twice - SetWasEngaged(false); - if (!_EnterEvadeMode(why)) return; @@ -184,11 +179,7 @@ void CreatureAI::EnterEvadeMode(EvadeReason why) bool CreatureAI::UpdateVictim() { - bool wasEngaged = SetWasEngaged(me->IsEngaged()); - - // Don't skip the checks below if we were engaged in the tick before and are not engaged anymore now - // (and we didn't evade yet. Notice that EnterEvadeMode() calls SetWasEngaged(false) ) - if (!wasEngaged && !me->IsEngaged()) + if (!me->IsEngaged()) return false; if (!me->HasReactState(REACT_PASSIVE)) @@ -366,10 +357,3 @@ Creature* CreatureAI::DoSummonFlyer(uint32 entry, WorldObject* obj, float flight pos.m_positionZ += flightZ; return me->SummonCreature(entry, pos, summonType, despawnTime); } - -bool CreatureAI::SetWasEngaged(bool value) -{ - bool previousValue = _wasEngaged; - _wasEngaged = value; - return previousValue; -} diff --git a/src/server/game/AI/CreatureAI.h b/src/server/game/AI/CreatureAI.h index 39014837555..5931b447d06 100644 --- a/src/server/game/AI/CreatureAI.h +++ b/src/server/game/AI/CreatureAI.h @@ -243,11 +243,8 @@ class TC_GAME_API CreatureAI : public UnitAI private: void OnOwnerCombatInteraction(Unit* target); - // Returns the value of IsEngaged() from the previous tick - bool SetWasEngaged(bool value); bool _moveInLOSLocked; - bool _wasEngaged; }; #endif diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp index 05b0aab0164..b46fe069cfb 100644 --- a/src/server/game/Groups/Group.cpp +++ b/src/server/game/Groups/Group.cpp @@ -2173,7 +2173,7 @@ void Group::ResetInstances(uint8 method, bool isRaid, Player* SendMsgTo) // do not reset the instance, just unbind if others are permanently bound to it if (isEmpty && instanceSave->CanReset()) { - if (map && isRaidGroup() && map->IsDungeon() && SendMsgTo) + if (map && this->isRaidGroup() && map->IsDungeon() && SendMsgTo) { AreaTrigger const * const instanceEntrance = sObjectMgr->GetGoBackTrigger(map->GetId()); @@ -2184,7 +2184,7 @@ void Group::ResetInstances(uint8 method, bool isRaid, Player* SendMsgTo) WorldSafeLocsEntry const * graveyardLocation = sObjectMgr->GetClosestGraveyard(instanceEntrance->target_X, instanceEntrance->target_Y, instanceEntrance->target_Z, instanceEntrance->target_mapId, SendMsgTo->GetTeam());; uint32 const zoneId = sMapMgr->GetZoneId(graveyardLocation->map_id, graveyardLocation->x, graveyardLocation->y, graveyardLocation->z); - for (const MemberSlot &member : GetMemberSlots()) + for (const MemberSlot &member : this->GetMemberSlots()) { if (!ObjectAccessor::FindConnectedPlayer(member.guid)) { @@ -2196,7 +2196,7 @@ void Group::ResetInstances(uint8 method, bool isRaid, Player* SendMsgTo) stmt->setFloat(3, instanceEntrance->target_Orientation); stmt->setUInt32(4, graveyardLocation->map_id); stmt->setUInt32(5, zoneId); - stmt->setUInt32(6, member.guid.GetCounter()); + stmt->setUInt32(6, member.guid); stmt->setUInt32(7, map->GetId()); CharacterDatabase.Execute(stmt); |