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

+7 -7
View File
@@ -7901,7 +7901,7 @@ MountCapabilityEntry const* Unit::GetMountCapability(uint32 mountType) const
uint32 areaId = GetAreaId();
uint32 ridingSkill = 5000;
uint32 mountFlags = 0;
EnumFlag<AreaMountFlags> mountFlags = AreaMountFlags::None;
bool isUnderwater = false;
bool isInWater = false;
@@ -7911,10 +7911,10 @@ MountCapabilityEntry const* Unit::GetMountCapability(uint32 mountType) const
if (HasAuraType(SPELL_AURA_MOUNT_RESTRICTIONS))
{
for (AuraEffect const* auraEffect : GetAuraEffectsByType(SPELL_AURA_MOUNT_RESTRICTIONS))
mountFlags |= auraEffect->GetMiscValue();
mountFlags |= AreaMountFlags(auraEffect->GetMiscValue());
}
else if (AreaTableEntry const* areaTable = sAreaTableStore.LookupEntry(areaId))
mountFlags = areaTable->MountFlags;
mountFlags = areaTable->GetMountFlags();
ZLiquidStatus liquidStatus = GetLiquidStatus();
isUnderwater = (liquidStatus & LIQUID_MAP_UNDER_WATER) != 0;
@@ -7931,13 +7931,13 @@ MountCapabilityEntry const* Unit::GetMountCapability(uint32 mountType) const
if (!(mountCapability->Flags & MOUNT_CAPABIILTY_FLAG_IGNORE_RESTRICTIONS))
{
if (mountCapability->Flags & MOUNT_CAPABILITY_FLAG_GROUND && !(mountFlags & AREA_MOUNT_FLAG_GROUND_ALLOWED))
if (mountCapability->Flags & MOUNT_CAPABILITY_FLAG_GROUND && !(mountFlags.HasFlag(AreaMountFlags::AllowGroundMounts)))
continue;
if (mountCapability->Flags & MOUNT_CAPABILITY_FLAG_FLYING && !(mountFlags & AREA_MOUNT_FLAG_FLYING_ALLOWED))
if (mountCapability->Flags & MOUNT_CAPABILITY_FLAG_FLYING && !(mountFlags.HasFlag(AreaMountFlags::AllowFlyingMounts)))
continue;
if (mountCapability->Flags & MOUNT_CAPABILITY_FLAG_FLOAT && !(mountFlags & AREA_MOUNT_FLAG_FLOAT_ALLOWED))
if (mountCapability->Flags & MOUNT_CAPABILITY_FLAG_FLOAT && !(mountFlags.HasFlag(AreaMountFlags::AllowSurfaceSwimmingMounts)))
continue;
if (mountCapability->Flags & MOUNT_CAPABILITY_FLAG_UNDERWATER && !(mountFlags & AREA_MOUNT_FLAG_UNDERWATER_ALLOWED))
if (mountCapability->Flags & MOUNT_CAPABILITY_FLAG_UNDERWATER && !(mountFlags.HasFlag(AreaMountFlags::AllowUnderwaterSwimmingMounts)))
continue;
}