fix flying form in no fly zones after teleport
This commit is contained in:
1 parent
9a074db8bf
commit
24792b9361
2 files changed
+22
-1
No files matched your search
@@ -24927,7 +24927,24 @@ bool Player::CanFlyInZone(uint32 mapid, uint32 zone) const
|
||||
{
|
||||
// continent checked in SpellInfo::CheckLocation at cast and area update
|
||||
uint32 v_map = GetVirtualMapForMapAndZone(mapid, zone);
|
||||
return v_map != 571 || HasSpell(54197); // 54197 = Cold Weather Flying
|
||||
bool can_fly = false;
|
||||
switch (v_map)
|
||||
{
|
||||
case 0: // Eastern Kingdoms
|
||||
case 1: // Kalimdor
|
||||
case 646: // Deepholm
|
||||
can_fly = HasSpell(90267); // Flight Master's License
|
||||
break;
|
||||
case 571: // Northrend
|
||||
can_fly = HasSpell(54197); // Cold Weather Flying
|
||||
break;
|
||||
case 530: // Outland
|
||||
can_fly = true;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
TC_LOG_DEBUG("network", "------Gangrene------ mapid=%u zone=%u v_map=%u result=%u",mapid,zone,v_map,can_fly);
|
||||
return can_fly;
|
||||
}
|
||||
|
||||
void Player::LearnSpellHighestRank(uint32 spellid)
|
||||
|
||||
@@ -185,6 +185,10 @@ void WorldSession::HandleMoveWorldportAckOpcode()
|
||||
GetPlayer()->GetZoneAndAreaId(newzone, newarea);
|
||||
GetPlayer()->UpdateZone(newzone, newarea);
|
||||
|
||||
// can fly check
|
||||
if (!_player->CanFlyInZone(newMap->GetId(), newarea))
|
||||
_player->RemoveAurasByType(SPELL_AURA_FLY);
|
||||
|
||||
// honorless target
|
||||
if (GetPlayer()->pvpInfo.IsHostile)
|
||||
GetPlayer()->CastSpell(GetPlayer(), 2479, true);
|
||||
|
||||
Reference in new issue
Block a user