rendered paste bodyIndex: src/game/MiscHandler.cpp===================================================================--- src/game/MiscHandler.cpp (revision 5485)+++ src/game/MiscHandler.cpp (working copy)@@ -516,17 +516,7 @@ _player->SetUInt32Value(UNIT_FIELD_BYTES_1 , bytes1); if (_player->IsStandState())- {- // cancel drinking / eating- Unit::AuraMap& p_auras = _player->GetAuras();- for (Unit::AuraMap::iterator itr = p_auras.begin(); itr != p_auras.end();)- {- if (itr->second && (itr->second->GetSpellProto()->AuraInterruptFlags & AURA_INTERRUPT_FLAG_NOT_SEATED) != 0)- _player->RemoveAura(itr);- else- ++itr;- }- }+ _player->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_NOT_SEATED); } } Index: src/game/Player.cpp===================================================================--- src/game/Player.cpp (revision 5485)+++ src/game/Player.cpp (working copy)@@ -1878,24 +1878,9 @@ //TODO: exist also swimming mobs, and function must be symmetric to enter/leave water m_isInWater = apply; - // form update- if(apply)- {- // remove travel forms- if(m_form == FORM_TRAVEL || m_form == FORM_GHOSTWOLF)- RemoveAurasDueToSpell(m_ShapeShiftForm);+ // remove auras that need water/land+ RemoveAurasWithInterruptFlags(apply ? AURA_INTERRUPT_FLAG_NOT_ABOVEWATER : AURA_INTERRUPT_FLAG_NOT_UNDERWATER); - // remove mounts, check flight mounts also (flying=swimming in air :D)- if(IsMounted() && !IsFlying())- RemoveSpellsCausingAura(SPELL_AURA_MOUNTED);- }- else- {- // remove aqua form- if(m_form == FORM_AQUA)- RemoveAurasDueToSpell(m_ShapeShiftForm);- }- getHostilRefManager().updateThreatTables(); } @@ -4915,14 +4900,11 @@ if( teleport || old_x != x || old_y != y || old_r != orientation ) {- // remove at movement non-move stealth aura- if(GetVisibility()==VISIBILITY_GROUP_STEALTH)- RemoveAurasDueToSpell(20580);+ if (teleport || old_x != x || old_y != y)+ RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_MOVE | AURA_INTERRUPT_FLAG_TURNING);+ else+ RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_TURNING); - // remove death simulation at move- if(hasUnitState(UNIT_STAT_DIED))- RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);- // move and update visible state if need m->PlayerRelocation(this, x, y, z, orientation); Index: src/game/Unit.cpp===================================================================--- src/game/Unit.cpp (revision 5485)+++ src/game/Unit.cpp (working copy)@@ -3925,6 +3925,17 @@ ++iter; } }+ +void Unit::RemoveAurasWithInterruptFlags(uint32 flags)+{+ for (AuraMap::iterator iter = m_Auras.begin(); iter != m_Auras.end(); )+ {+ if (iter->second->GetSpellProto()->AuraInterruptFlags & flags)+ RemoveAura(iter);+ else+ ++iter;+ }+} void Unit::RemoveAura(AuraMap::iterator &i, bool onDeath) {Index: src/game/Unit.h===================================================================--- src/game/Unit.h (revision 5485)+++ src/game/Unit.h (working copy)@@ -843,6 +843,7 @@ void RemoveRankAurasDueToSpell(uint32 spellId); bool RemoveNoStackAurasDueToAura(Aura *Aur); void RemoveAreaAurasByOthers(uint64 guid = 0);+ void RemoveAurasWithInterruptFlags(uint32 flags); void RemoveAllAuras(); void RemoveAllAurasOnDeath();