fix(Core/Spells): Dismount from flying mount if teleported to Nothrend without Cold Weather Flying spell. (#8524)

Fixes #5660
This commit is contained in:
UltraNix
2021-10-20 10:29:58 +02:00
committed by GitHub
parent 1ec612e65b
commit fb1e750de2
2 changed files with 7 additions and 19 deletions

View File

@@ -1498,27 +1498,15 @@ SpellCastResult SpellInfo::CheckLocation(uint32 map_id, uint32 zone_id, uint32 a
// continent limitation (virtual continent)
if (HasAttribute(SPELL_ATTR4_ONLY_FLYING_AREAS))
{
if (strict)
AreaTableEntry const* areaEntry = sAreaTableStore.LookupEntry(area_id);
if (!areaEntry)
{
AreaTableEntry const* areaEntry = sAreaTableStore.LookupEntry(area_id);
if (!areaEntry)
{
areaEntry = sAreaTableStore.LookupEntry(zone_id);
}
if (!areaEntry || !areaEntry->IsFlyable() || !player->canFlyInZone(map_id, zone_id, this))
{
return SPELL_FAILED_INCORRECT_AREA;
}
areaEntry = sAreaTableStore.LookupEntry(zone_id);
}
else
if (!areaEntry || !areaEntry->IsFlyable() || (strict && (areaEntry->flags & AREA_FLAG_NO_FLY_ZONE) != 0) || !player->canFlyInZone(map_id, zone_id, this))
{
uint32 const v_map = GetVirtualMapForMapAndZone(map_id, zone_id);
MapEntry const* mapEntry = sMapStore.LookupEntry(v_map);
if (!mapEntry || mapEntry->Expansion() < 1 || !mapEntry->IsContinent())
{
return SPELL_FAILED_INCORRECT_AREA;
}
return SPELL_FAILED_INCORRECT_AREA;
}
}