Core/Areas: Update AreaFlags from EnumeratedStings values

This commit is contained in:
Jeremy authored and Ovahlord committed 2023-10-09 20:41:30 +02:00
1 parent b17169b5b1
commit f8aa09f253
10 files changed
+77 -79

No files matched your search

+4 -4
View File
@@ -1747,16 +1747,16 @@ SpellCastResult SpellInfo::CheckLocation(uint32 map_id, uint32 zone_id, uint32 a
// continent limitation (virtual continent)
if (HasAttribute(SPELL_ATTR4_ONLY_FLYING_AREAS))
{
uint32 mountFlags = 0;
EnumFlag<AreaMountFlags> mountFlags = AreaMountFlags::None;
if (player && player->HasAuraType(SPELL_AURA_MOUNT_RESTRICTIONS))
{
for (AuraEffect const* auraEffect : player->GetAuraEffectsByType(SPELL_AURA_MOUNT_RESTRICTIONS))
mountFlags |= auraEffect->GetMiscValue();
mountFlags |= AreaMountFlags(auraEffect->GetMiscValue());
}
else if (AreaTableEntry const* areaTable = sAreaTableStore.LookupEntry(area_id))
mountFlags = areaTable->MountFlags;
mountFlags = areaTable->GetMountFlags();
if (!(mountFlags & AREA_MOUNT_FLAG_FLYING_ALLOWED))
if (!(mountFlags.HasFlag(AreaMountFlags::AllowFlyingMounts)))
return SPELL_FAILED_INCORRECT_AREA;
}