mirror of
https://github.com/mangosfour/server.git
synced 2025-12-12 10:37:03 +00:00
[12019] Various changes
* Add some const correctness * Remove unused Unit::isHover() function * Help compiler optimize code from last commit (thx to vladimir)
This commit is contained in:
parent
6d49f2bbee
commit
01b6c6b8f4
4 changed files with 7 additions and 8 deletions
|
|
@ -2170,7 +2170,8 @@ bool Creature::HasSpellCooldown(uint32 spell_id) const
|
|||
|
||||
uint8 Creature::getRace() const
|
||||
{
|
||||
return Unit::getRace() ? Unit::getRace() : GetCreatureModelRace(GetNativeDisplayId());
|
||||
uint8 race = Unit::getRace();
|
||||
return race ? race : GetCreatureModelRace(GetNativeDisplayId());
|
||||
}
|
||||
|
||||
bool Creature::IsInEvadeMode() const
|
||||
|
|
|
|||
|
|
@ -8625,7 +8625,7 @@ void Unit::TauntFadeOut(Unit *taunter)
|
|||
|
||||
//======================================================================
|
||||
|
||||
bool Unit::IsSecondChoiceTarget(Unit* pTarget, bool checkThreatArea)
|
||||
bool Unit::IsSecondChoiceTarget(Unit* pTarget, bool checkThreatArea) const
|
||||
{
|
||||
MANGOS_ASSERT(pTarget && GetTypeId() == TYPEID_UNIT);
|
||||
|
||||
|
|
|
|||
|
|
@ -1387,7 +1387,7 @@ class MANGOS_DLL_SPEC Unit : public WorldObject
|
|||
bool IsIgnoreUnitState(SpellEntry const *spell, IgnoreUnitState ignoreState);
|
||||
|
||||
bool isTargetableForAttack(bool inversAlive = false) const;
|
||||
bool isPassiveToHostile() { return HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PASSIVE); }
|
||||
bool isPassiveToHostile() const { return HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PASSIVE); }
|
||||
|
||||
virtual bool IsInWater() const;
|
||||
virtual bool IsUnderWater() const;
|
||||
|
|
@ -1673,7 +1673,7 @@ class MANGOS_DLL_SPEC Unit : public WorldObject
|
|||
void AddThreat(Unit* pVictim, float threat = 0.0f, bool crit = false, SpellSchoolMask schoolMask = SPELL_SCHOOL_MASK_NONE, SpellEntry const *threatSpell = NULL);
|
||||
float ApplyTotalThreatModifier(float threat, SpellSchoolMask schoolMask = SPELL_SCHOOL_MASK_NORMAL);
|
||||
void DeleteThreatList();
|
||||
bool IsSecondChoiceTarget(Unit* pTarget, bool checkThreatArea);
|
||||
bool IsSecondChoiceTarget(Unit* pTarget, bool checkThreatArea) const;
|
||||
bool SelectHostileTarget();
|
||||
void TauntApply(Unit* pVictim);
|
||||
void TauntFadeOut(Unit *taunter);
|
||||
|
|
@ -1845,8 +1845,6 @@ class MANGOS_DLL_SPEC Unit : public WorldObject
|
|||
float GetSpeedRate( UnitMoveType mtype ) const { return m_speed_rate[mtype]; }
|
||||
void SetSpeedRate(UnitMoveType mtype, float rate, bool forced = false);
|
||||
|
||||
bool isHover() const { return HasAuraType(SPELL_AURA_HOVER); }
|
||||
|
||||
void KnockBackFrom(Unit* target, float horizontalSpeed, float verticalSpeed);
|
||||
|
||||
void _RemoveAllAuraMods();
|
||||
|
|
@ -1908,7 +1906,7 @@ class MANGOS_DLL_SPEC Unit : public WorldObject
|
|||
void _SetAINotifyScheduled(bool on) { m_AINotifyScheduled = on;} // only for call from RelocationNotifyEvent code
|
||||
void OnRelocated();
|
||||
|
||||
bool IsLinkingEventTrigger() { return m_isCreatureLinkingTrigger; }
|
||||
bool IsLinkingEventTrigger() const { return m_isCreatureLinkingTrigger; }
|
||||
|
||||
protected:
|
||||
explicit Unit ();
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "12018"
|
||||
#define REVISION_NR "12019"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue