fix(Core/Spells): Dismount from flying mount if teleported to Nothrend without Cold Weather Flying spell. (#8524)
Fixes #5660
This commit is contained in:
@@ -1498,27 +1498,15 @@ SpellCastResult SpellInfo::CheckLocation(uint32 map_id, uint32 zone_id, uint32 a
|
|||||||
// continent limitation (virtual continent)
|
// continent limitation (virtual continent)
|
||||||
if (HasAttribute(SPELL_ATTR4_ONLY_FLYING_AREAS))
|
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);
|
areaEntry = sAreaTableStore.LookupEntry(zone_id);
|
||||||
if (!areaEntry)
|
|
||||||
{
|
|
||||||
areaEntry = sAreaTableStore.LookupEntry(zone_id);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!areaEntry || !areaEntry->IsFlyable() || !player->canFlyInZone(map_id, zone_id, this))
|
|
||||||
{
|
|
||||||
return SPELL_FAILED_INCORRECT_AREA;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
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);
|
return SPELL_FAILED_INCORRECT_AREA;
|
||||||
MapEntry const* mapEntry = sMapStore.LookupEntry(v_map);
|
|
||||||
if (!mapEntry || mapEntry->Expansion() < 1 || !mapEntry->IsContinent())
|
|
||||||
{
|
|
||||||
return SPELL_FAILED_INCORRECT_AREA;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -538,7 +538,7 @@ struct AreaTableEntry
|
|||||||
|
|
||||||
[[nodiscard]] bool IsFlyable() const
|
[[nodiscard]] bool IsFlyable() const
|
||||||
{
|
{
|
||||||
return flags & AREA_FLAG_OUTLAND && !(flags & AREA_FLAG_NO_FLY_ZONE);
|
return flags & AREA_FLAG_OUTLAND;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user