Removed Unit::waterbreath. This information is not needed for creatures and can be obtained for players by Unit::HasAuraType(SPELL_AURA_WATER_BREATHING) in constant time

This commit is contained in:
arrai 2009-01-14 14:42:38 +01:00
parent c7a5537bac
commit 022e7ad2b5
4 changed files with 2 additions and 8 deletions

View file

@ -872,7 +872,7 @@ void Player::HandleDrowning()
return;
//if player is GM, have waterbreath, is dead or if breathing is disabled then return
if(waterbreath || isGameMaster() || !isAlive() || GetSession()->GetSecurity() >= sWorld.getConfig(CONFIG_DISABLE_BREATHING))
if(HasAuraType(SPELL_AURA_WATER_BREATHING) || isGameMaster() || !isAlive() || GetSession()->GetSecurity() >= sWorld.getConfig(CONFIG_DISABLE_BREATHING))
{
StopMirrorTimer(BREATH_TIMER);
m_isunderwater = 0;

View file

@ -2499,12 +2499,8 @@ void Aura::HandleAuraHover(bool apply, bool Real)
void Aura::HandleWaterBreathing(bool apply, bool Real)
{
if(apply)
m_target->waterbreath = true;
else if(m_target->GetAurasByType(SPELL_AURA_WATER_BREATHING).empty())
if(!apply && m_target->GetAurasByType(SPELL_AURA_WATER_BREATHING).empty())
{
m_target->waterbreath = false;
// update for enable timer in case not moving target
if(m_target->GetTypeId()==TYPEID_PLAYER && m_target->IsInWorld())
{

View file

@ -102,7 +102,6 @@ Unit::Unit()
//m_AurasCheck = 2000;
//m_removeAuraTimer = 4;
//tmpAura = NULL;
waterbreath = false;
m_Visibility = VISIBILITY_ON;

View file

@ -1208,7 +1208,6 @@ class MANGOS_DLL_SPEC Unit : public WorldObject
// function for low level grid visibility checks in player/creature cases
virtual bool IsVisibleInGridForPlayer(Player* pl) const = 0;
bool waterbreath;
AuraList & GetSingleCastAuras() { return m_scAuras; }
AuraList const& GetSingleCastAuras() const { return m_scAuras; }
SpellImmuneList m_spellImmune[MAX_SPELL_IMMUNITY];