[7154] Move allow player fly check to function.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
GriffonHeart 2009-01-23 15:47:14 +03:00 committed by VladimirMangos
parent 10468d170d
commit 25b120877e
4 changed files with 13 additions and 5 deletions

View file

@ -18872,8 +18872,7 @@ void Player::SetClientControl(Unit* target, uint8 allowMove)
void Player::UpdateZoneDependentAuras( uint32 newZone )
{
// remove new continent flight forms
uint32 v_map = GetVirtualMapForMapAndZone(GetMapId(), newZone);
if( !isGameMaster() && v_map != 530 && v_map != 571)
if( !IsAllowUseFlyMountsHere() )
{
RemoveSpellsCausingAura(SPELL_AURA_MOD_INCREASE_FLIGHT_SPEED);
RemoveSpellsCausingAura(SPELL_AURA_FLY);
@ -19363,3 +19362,12 @@ uint32 Player::CalculateTalentsPoints() const
return talentPointsForLevel;
}
bool Player::IsAllowUseFlyMountsHere() const
{
if (isGameMaster())
return true;
uint32 v_map = GetVirtualMapForMapAndZone(GetMapId(), GetZoneId());
return v_map == 530 || v_map == 571 && HasSpell(54197);
}