mirror of
https://github.com/mangosfour/server.git
synced 2025-12-16 04:37:00 +00:00
[11461] Use ObjectGuid in GuardAI also...
This commit is contained in:
parent
b4f2e3d1a0
commit
4989ffba9d
3 changed files with 8 additions and 7 deletions
|
|
@ -30,7 +30,7 @@ int GuardAI::Permissible(const Creature *creature)
|
||||||
return PERMIT_BASE_NO;
|
return PERMIT_BASE_NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
GuardAI::GuardAI(Creature *c) : CreatureAI(c), i_victimGuid(0), i_state(STATE_NORMAL), i_tracker(TIME_INTERVAL_LOOK)
|
GuardAI::GuardAI(Creature *c) : CreatureAI(c), i_state(STATE_NORMAL), i_tracker(TIME_INTERVAL_LOOK)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -64,7 +64,7 @@ void GuardAI::EnterEvadeMode()
|
||||||
|
|
||||||
i_state = STATE_NORMAL;
|
i_state = STATE_NORMAL;
|
||||||
|
|
||||||
i_victimGuid = 0;
|
i_victimGuid.Clear();
|
||||||
m_creature->CombatStop(true);
|
m_creature->CombatStop(true);
|
||||||
m_creature->DeleteThreatList();
|
m_creature->DeleteThreatList();
|
||||||
return;
|
return;
|
||||||
|
|
@ -95,7 +95,7 @@ void GuardAI::EnterEvadeMode()
|
||||||
|
|
||||||
m_creature->RemoveAllAuras();
|
m_creature->RemoveAllAuras();
|
||||||
m_creature->DeleteThreatList();
|
m_creature->DeleteThreatList();
|
||||||
i_victimGuid = 0;
|
i_victimGuid.Clear();
|
||||||
m_creature->CombatStop(true);
|
m_creature->CombatStop(true);
|
||||||
i_state = STATE_NORMAL;
|
i_state = STATE_NORMAL;
|
||||||
|
|
||||||
|
|
@ -110,7 +110,7 @@ void GuardAI::UpdateAI(const uint32 /*diff*/)
|
||||||
if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
|
if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
i_victimGuid = m_creature->getVictim()->GetGUID();
|
i_victimGuid = m_creature->getVictim()->GetObjectGuid();
|
||||||
|
|
||||||
DoMeleeAttackIfReady();
|
DoMeleeAttackIfReady();
|
||||||
}
|
}
|
||||||
|
|
@ -128,7 +128,7 @@ void GuardAI::AttackStart(Unit *u)
|
||||||
|
|
||||||
if(m_creature->Attack(u,true))
|
if(m_creature->Attack(u,true))
|
||||||
{
|
{
|
||||||
i_victimGuid = u->GetGUID();
|
i_victimGuid = u->GetObjectGuid();
|
||||||
m_creature->AddThreat(u);
|
m_creature->AddThreat(u);
|
||||||
m_creature->SetInCombatWith(u);
|
m_creature->SetInCombatWith(u);
|
||||||
u->SetInCombatWith(m_creature);
|
u->SetInCombatWith(m_creature);
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@
|
||||||
#define MANGOS_GUARDAI_H
|
#define MANGOS_GUARDAI_H
|
||||||
|
|
||||||
#include "CreatureAI.h"
|
#include "CreatureAI.h"
|
||||||
|
#include "ObjectGuid.h"
|
||||||
#include "Timer.h"
|
#include "Timer.h"
|
||||||
|
|
||||||
class Creature;
|
class Creature;
|
||||||
|
|
@ -46,7 +47,7 @@ class MANGOS_DLL_DECL GuardAI : public CreatureAI
|
||||||
static int Permissible(const Creature *);
|
static int Permissible(const Creature *);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
uint64 i_victimGuid;
|
ObjectGuid i_victimGuid;
|
||||||
GuardState i_state;
|
GuardState i_state;
|
||||||
TimeTracker i_tracker;
|
TimeTracker i_tracker;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "11460"
|
#define REVISION_NR "11461"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue