Revert "Core/AI: Fix Guardians not following the owner after finishing combat (#23466)"

This reverts commit c234604e82.
This commit is contained in:
Treeston
2019-06-22 22:21:09 +02:00
parent eeced9ae15
commit c06330acf2
3 changed files with 5 additions and 24 deletions

View File

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

View File

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

View File

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