Misc fixes

This commit is contained in:
hondacrx
2024-03-19 17:21:32 -04:00
parent 5237c49b77
commit 1e421b9f53
71 changed files with 337 additions and 319 deletions
+2 -2
View File
@@ -364,7 +364,7 @@ namespace Game.Entities
var factionTemplate = CliDB.FactionTemplateStorage.LookupByKey(cInfo.Faction);
if (factionTemplate != null)
{
SetPvP(factionTemplate.Flags.HasAnyFlag((ushort)FactionTemplateFlags.PVP));
SetPvP(factionTemplate.HasFlag(FactionTemplateFlags.PVP));
if (IsTaxi())
{
uint taxiNodesId = Global.ObjectMgr.GetNearestTaxiNode(GetPositionX(), GetPositionY(), GetPositionZ(), GetMapId(),
@@ -1507,7 +1507,7 @@ namespace Game.Entities
PowerTypeRecord powerTypeEntry = Global.DB2Mgr.GetPowerTypeEntry(powerType);
if (powerTypeEntry != null)
{
if (powerTypeEntry.GetFlags().HasFlag(PowerTypeFlags.UnitsUseDefaultPowerOnInit))
if (powerTypeEntry.HasFlag(PowerTypeFlags.UnitsUseDefaultPowerOnInit))
SetPower(powerType, powerTypeEntry.DefaultPower);
else
SetFullPower(powerType);
+9 -9
View File
@@ -154,7 +154,7 @@ namespace Game.Entities
for (EnchantmentSlot slot = 0; slot < EnchantmentSlot.Max; ++slot)
{
var enchantment = CliDB.SpellItemEnchantmentStorage.LookupByKey(GetEnchantmentId(slot));
if (enchantment != null && !enchantment.GetFlags().HasFlag(SpellItemEnchantmentFlags.DoNotSaveToDB))
if (enchantment != null && !enchantment.HasFlag(SpellItemEnchantmentFlags.DoNotSaveToDB))
ss.Append($"{GetEnchantmentId(slot)} {GetEnchantmentDuration(slot)} {GetEnchantmentCharges(slot)} ");
else
ss.Append("0 0 0 ");
@@ -613,7 +613,7 @@ namespace Game.Entities
foreach (ArtifactPowerData power in powers)
{
ArtifactPowerRecord scaledArtifactPowerEntry = CliDB.ArtifactPowerStorage.LookupByKey(power.ArtifactPowerId);
if (!scaledArtifactPowerEntry.Flags.HasAnyFlag(ArtifactPowerFlag.ScalesWithNumPowers))
if (!scaledArtifactPowerEntry.HasFlag(ArtifactPowerFlag.ScalesWithNumPowers))
continue;
SetArtifactPower((ushort)power.ArtifactPowerId, power.PurchasedRank, (byte)(totalPurchasedRanks + 1));
@@ -925,7 +925,7 @@ namespace Game.Entities
{
var enchantEntry = CliDB.SpellItemEnchantmentStorage.LookupByKey(enchant_id);
if (enchantEntry != null)
if (enchantEntry.GetFlags().HasFlag(SpellItemEnchantmentFlags.Soulbound))
if (enchantEntry.HasFlag(SpellItemEnchantmentFlags.Soulbound))
return true;
}
}
@@ -994,11 +994,11 @@ namespace Game.Entities
if (slot < EnchantmentSlot.MaxInspected)
{
var oldEnchant = CliDB.SpellItemEnchantmentStorage.LookupByKey(GetEnchantmentId(slot));
if (oldEnchant != null && !oldEnchant.GetFlags().HasFlag(SpellItemEnchantmentFlags.DoNotLog))
if (oldEnchant != null && !oldEnchant.HasFlag(SpellItemEnchantmentFlags.DoNotLog))
owner.GetSession().SendEnchantmentLog(GetOwnerGUID(), ObjectGuid.Empty, GetGUID(), GetEntry(), oldEnchant.Id, (uint)slot);
var newEnchant = CliDB.SpellItemEnchantmentStorage.LookupByKey(id);
if (newEnchant != null && !newEnchant.GetFlags().HasFlag(SpellItemEnchantmentFlags.DoNotLog))
if (newEnchant != null && !newEnchant.HasFlag(SpellItemEnchantmentFlags.DoNotLog))
owner.GetSession().SendEnchantmentLog(GetOwnerGUID(), caster, GetGUID(), GetEntry(), id, (uint)slot);
}
@@ -2188,7 +2188,7 @@ namespace Game.Entities
ArtifactPowerData powerData = new();
powerData.ArtifactPowerId = artifactPower.Id;
powerData.PurchasedRank = 0;
powerData.CurrentRankWithBonus = (byte)((artifactPower.Flags & ArtifactPowerFlag.First) == ArtifactPowerFlag.First ? 1 : 0);
powerData.CurrentRankWithBonus = (byte)((artifactPower.Flags & (byte)ArtifactPowerFlag.First) == (byte)ArtifactPowerFlag.First ? 1 : 0);
AddArtifactPower(powerData);
}
}
@@ -2443,7 +2443,7 @@ namespace Game.Entities
if (set.RequiredSkill != 0 && player.GetSkillValue((SkillType)set.RequiredSkill) < set.RequiredSkillRank)
return;
if (set.SetFlags.HasAnyFlag(ItemSetFlags.LegacyInactive))
if (set.HasFlag(ItemSetFlags.LegacyInactive))
return;
// Check player level for heirlooms
@@ -3133,13 +3133,13 @@ namespace Game.Entities
{
uint maxRank = artifactPower.MaxPurchasableRank;
// allow ARTIFACT_POWER_FLAG_FINAL to overflow maxrank here - needs to be handled in Item::CheckArtifactUnlock (will refund artifact power)
if (artifactPower.Flags.HasAnyFlag(ArtifactPowerFlag.MaxRankWithTier) && artifactPower.Tier < info.Artifact.ArtifactTierId)
if (artifactPower.HasFlag(ArtifactPowerFlag.MaxRankWithTier) && artifactPower.Tier < info.Artifact.ArtifactTierId)
maxRank += info.Artifact.ArtifactTierId - artifactPower.Tier;
if (artifactPowerData.PurchasedRank > maxRank)
artifactPowerData.PurchasedRank = (byte)maxRank;
artifactPowerData.CurrentRankWithBonus = (byte)((artifactPower.Flags & ArtifactPowerFlag.First) == ArtifactPowerFlag.First ? 1 : 0);
artifactPowerData.CurrentRankWithBonus = (byte)((artifactPower.Flags & (byte)ArtifactPowerFlag.First) == (byte)ArtifactPowerFlag.First ? 1 : 0);
info.Artifact.ArtifactPowers.Add(artifactPowerData);
}
+5 -5
View File
@@ -115,7 +115,7 @@ namespace Game.Entities
var area = CliDB.AreaTableStorage.LookupByKey(m_areaId);
if (area != null)
if (area.ParentAreaID != 0 && area.GetFlags().HasFlag(AreaFlags.IsSubzone))
if (area.ParentAreaID != 0 && area.HasFlag(AreaFlags.IsSubzone))
m_zoneId = area.ParentAreaID;
m_outdoors = data.outdoors;
@@ -2262,7 +2262,7 @@ namespace Game.Entities
if (tempSummon == null || tempSummon.m_Properties == null)
return false;
if (tempSummon.m_Properties.GetFlags().HasFlag(SummonPropertiesFlags.AttackableBySummoner)
if (tempSummon.m_Properties.HasFlag(SummonPropertiesFlags.AttackableBySummoner)
&& targetGuid == tempSummon.GetSummonerGUID())
return true;
@@ -2345,7 +2345,7 @@ namespace Game.Entities
if (targetFactionEntry.CanHaveReputation())
{
// check contested flags
if ((targetFactionTemplateEntry.Flags & (ushort)FactionTemplateFlags.ContestedGuard) != 0 && selfPlayerOwner.HasPlayerFlag(PlayerFlags.ContestedPVP))
if (targetFactionTemplateEntry.HasFlag(FactionTemplateFlags.ContestedGuard) && selfPlayerOwner.HasPlayerFlag(PlayerFlags.ContestedPVP))
return ReputationRank.Hostile;
// if faction has reputation, hostile state depends only from AtWar state
@@ -2378,7 +2378,7 @@ namespace Game.Entities
if (targetPlayerOwner != null)
{
// check contested flags
if ((factionTemplateEntry.Flags & (ushort)FactionTemplateFlags.ContestedGuard) != 0 && targetPlayerOwner.HasPlayerFlag(PlayerFlags.ContestedPVP))
if (factionTemplateEntry.HasFlag(FactionTemplateFlags.ContestedGuard) && targetPlayerOwner.HasPlayerFlag(PlayerFlags.ContestedPVP))
return ReputationRank.Hostile;
var repRank = targetPlayerOwner.GetReputationMgr().GetForcedRankIfAny(factionTemplateEntry);
@@ -2409,7 +2409,7 @@ namespace Game.Entities
return ReputationRank.Friendly;
if (targetFactionTemplateEntry.IsFriendlyTo(factionTemplateEntry))
return ReputationRank.Friendly;
if ((factionTemplateEntry.Flags & (ushort)FactionTemplateFlags.HostileByDefault) != 0)
if (factionTemplateEntry.HasFlag(FactionTemplateFlags.HostileByDefault))
return ReputationRank.Hostile;
// neutral by default
return ReputationRank.Neutral;
+1 -1
View File
@@ -3606,7 +3606,7 @@ namespace Game.Entities
foreach (var transmogIllusion in CliDB.TransmogIllusionStorage.Values)
{
if (!transmogIllusion.GetFlags().HasFlag(TransmogIllusionFlags.PlayerConditionGrantsOnLogin))
if (!transmogIllusion.HasFlag(TransmogIllusionFlags.PlayerConditionGrantsOnLogin))
continue;
if (GetSession().GetCollectionMgr().HasTransmogIllusion(transmogIllusion.Id))
+2 -2
View File
@@ -1876,7 +1876,7 @@ namespace Game.Entities
for (EnchantmentSlot enchantSlot = 0; enchantSlot < EnchantmentSlot.Max; ++enchantSlot)
{
var enchantment = CliDB.SpellItemEnchantmentStorage.LookupByKey(pItem.GetEnchantmentId(enchantSlot));
if (enchantment != null && enchantment.GetFlags().HasFlag(SpellItemEnchantmentFlags.MainhandOnly))
if (enchantment != null && enchantment.HasFlag(SpellItemEnchantmentFlags.MainhandOnly))
pItem.ClearEnchantment(enchantSlot);
}
@@ -5324,7 +5324,7 @@ namespace Game.Entities
if (rank == 0)
continue;
if (CliDB.ArtifactPowerStorage[artifactPower.ArtifactPowerId].Flags.HasAnyFlag(ArtifactPowerFlag.ScalesWithNumPowers))
if (CliDB.ArtifactPowerStorage[artifactPower.ArtifactPowerId].HasFlag(ArtifactPowerFlag.ScalesWithNumPowers))
rank = 1;
ArtifactPowerRankRecord artifactPowerRank = Global.DB2Mgr.GetArtifactPowerRank(artifactPower.ArtifactPowerId, (byte)(rank - 1));
+15 -15
View File
@@ -25,7 +25,7 @@ namespace Game.Entities
return m_legacyRaidDifficulty;
DifficultyRecord difficulty = CliDB.DifficultyStorage.LookupByKey(defaultDifficulty.DifficultyID);
if (difficulty == null || difficulty.Flags.HasAnyFlag(DifficultyFlags.Legacy))
if (difficulty == null || difficulty.HasFlag(DifficultyFlags.Legacy))
return m_legacyRaidDifficulty;
return m_raidDifficulty;
@@ -46,7 +46,7 @@ namespace Game.Entities
if (difficultyEntry.InstanceType != MapTypes.Instance)
return Difficulty.Normal;
if (!difficultyEntry.Flags.HasAnyFlag(DifficultyFlags.CanSelect))
if (!difficultyEntry.HasFlag(DifficultyFlags.CanSelect))
return Difficulty.Normal;
return difficulty;
@@ -60,7 +60,7 @@ namespace Game.Entities
if (difficultyEntry.InstanceType != MapTypes.Raid)
return Difficulty.NormalRaid;
if (!difficultyEntry.Flags.HasAnyFlag(DifficultyFlags.CanSelect) || difficultyEntry.Flags.HasAnyFlag(DifficultyFlags.Legacy))
if (!difficultyEntry.HasFlag(DifficultyFlags.CanSelect) || difficultyEntry.HasFlag(DifficultyFlags.Legacy))
return Difficulty.NormalRaid;
return difficulty;
@@ -74,7 +74,7 @@ namespace Game.Entities
if (difficultyEntry.InstanceType != MapTypes.Raid)
return Difficulty.Raid10N;
if (!difficultyEntry.Flags.HasAnyFlag(DifficultyFlags.CanSelect) || !difficultyEntry.Flags.HasAnyFlag(DifficultyFlags.Legacy))
if (!difficultyEntry.HasFlag(DifficultyFlags.CanSelect) || !difficultyEntry.HasFlag(DifficultyFlags.Legacy))
return Difficulty.Raid10N;
return difficulty;
@@ -99,7 +99,7 @@ namespace Game.Entities
AreaTableRecord oldAreaEntry = CliDB.AreaTableStorage.LookupByKey(oldArea);
AreaTableRecord area = CliDB.AreaTableStorage.LookupByKey(newArea);
bool oldFFAPvPArea = pvpInfo.IsInFFAPvPArea;
pvpInfo.IsInFFAPvPArea = area != null && area.GetFlags().HasFlag(AreaFlags.FreeForAllPvP);
pvpInfo.IsInFFAPvPArea = area != null && area.HasFlag(AreaFlags.FreeForAllPvP);
UpdatePvPState(true);
// check if we were in ffa arena and we left
@@ -127,7 +127,7 @@ namespace Game.Entities
RemovePvpFlag(UnitPVPStateFlags.Sanctuary);
AreaFlags areaRestFlag = (GetTeam() == Team.Alliance) ? AreaFlags.AllianceResting : AreaFlags.HordeResting;
if (area != null && area.GetFlags().HasFlag(areaRestFlag))
if (area != null && area.HasFlag(areaRestFlag))
_restMgr.SetRestFlag(RestFlag.FactionArea);
else
_restMgr.RemoveRestFlag(RestFlag.FactionArea);
@@ -136,8 +136,8 @@ namespace Game.Entities
UpdateMountCapability();
if ((oldAreaEntry != null && oldAreaEntry.GetFlags2().HasFlag(AreaFlags2.UseSubzoneForChatChannel))
|| (area != null && area.GetFlags2().HasFlag(AreaFlags2.UseSubzoneForChatChannel)))
if ((oldAreaEntry != null && oldAreaEntry.HasFlag(AreaFlags2.UseSubzoneForChatChannel))
|| (area != null && area.HasFlag(AreaFlags2.UseSubzoneForChatChannel)))
UpdateLocalChannels(newArea);
if (oldArea != newArea)
@@ -191,7 +191,7 @@ namespace Game.Entities
UpdateHostileAreaState(zone);
if (zone.GetFlags().HasFlag(AreaFlags.LinkedChat)) // Is in a capital city
if (zone.HasFlag(AreaFlags.LinkedChat)) // Is in a capital city
{
if (!pvpInfo.IsInHostileArea || zone.IsSanctuary())
_restMgr.SetRestFlag(RestFlag.City);
@@ -212,7 +212,7 @@ namespace Game.Entities
// recent client version not send leave/join channel packets for built-in local channels
var newAreaEntry = CliDB.AreaTableStorage.LookupByKey(newArea);
if (newAreaEntry == null || !newAreaEntry.GetFlags2().HasFlag(AreaFlags2.UseSubzoneForChatChannel))
if (newAreaEntry == null || !newAreaEntry.HasFlag(AreaFlags2.UseSubzoneForChatChannel))
UpdateLocalChannels(newZone);
UpdateZoneDependentAuras(newZone);
@@ -235,7 +235,7 @@ namespace Game.Entities
foreach (var vignette in GetMap().GetInfiniteAOIVignettes())
{
if (!vignette.Data.GetFlags().HasFlag(VignetteFlags.ZoneInfiniteAOI))
if (!vignette.Data.HasFlag(VignetteFlags.ZoneInfiniteAOI))
continue;
if (vignette.ZoneID == newZone && Vignettes.CanSee(this, vignette))
@@ -257,17 +257,17 @@ namespace Game.Entities
if (area.IsSanctuary()) // sanctuary and arena cannot be overriden
pvpInfo.IsInHostileArea = false;
else if (area.GetFlags().HasFlag(AreaFlags.FreeForAllPvP))
else if (area.HasFlag(AreaFlags.FreeForAllPvP))
pvpInfo.IsInHostileArea = true;
else if (overrideZonePvpType == ZonePVPTypeOverride.None)
{
if (area != null)
{
if (InBattleground() || area.GetFlags().HasFlag(AreaFlags.CombatZone) || (area.PvpCombatWorldStateID != -1 && Global.WorldStateMgr.GetValue(area.PvpCombatWorldStateID, GetMap()) != 0))
if (InBattleground() || area.HasFlag(AreaFlags.CombatZone) || (area.PvpCombatWorldStateID != -1 && Global.WorldStateMgr.GetValue(area.PvpCombatWorldStateID, GetMap()) != 0))
pvpInfo.IsInHostileArea = true;
else if (IsWarModeLocalActive() || area.GetFlags().HasFlag(AreaFlags.EnemiesPvPFlagged))
else if (IsWarModeLocalActive() || area.HasFlag(AreaFlags.EnemiesPvPFlagged))
{
if (area.GetFlags().HasFlag(AreaFlags.Contested))
if (area.HasFlag(AreaFlags.Contested))
pvpInfo.IsInHostileArea = IsWarModeLocalActive();
else
{
+1 -1
View File
@@ -356,7 +356,7 @@ namespace Game.Entities
if (area.IsSanctuary())
return false;
if (area.GetFlags().HasFlag(AreaFlags.FreeForAllPvP))
if (area.HasFlag(AreaFlags.FreeForAllPvP))
return true;
if (Global.BattleFieldMgr.IsWorldPvpArea(area.Id))
+8 -8
View File
@@ -33,7 +33,7 @@ namespace Game.Entities
if (Global.SpellMgr.GetSkillRangeType(rcEntry) == SkillRangeType.Level)
{
if (rcEntry.Flags.HasAnyFlag(SkillRaceClassInfoFlags.AlwaysMaxValue))
if (rcEntry.HasFlag(SkillRaceClassInfoFlags.AlwaysMaxValue))
SetSkillRank(pair.Value.Pos, maxSkill);
SetSkillMaxRank(pair.Value.Pos, maxSkill);
@@ -605,7 +605,7 @@ namespace Game.Entities
if ((m_unitData.MinItemLevel != 0 || m_unitData.MaxItemLevel != 0) && pEnchant.ScalingClassRestricted != 0)
scalingClass = pEnchant.ScalingClassRestricted;
uint minLevel = pEnchant.GetFlags().HasFlag(SpellItemEnchantmentFlags.ScaleAsAGem) ? 1 : 60u;
uint minLevel = pEnchant.HasFlag(SpellItemEnchantmentFlags.ScaleAsAGem) ? 1 : 60u;
uint scalingLevel = GetLevel();
byte maxLevel = (byte)(pEnchant.MaxLevel != 0 ? pEnchant.MaxLevel : CliDB.SpellScalingGameTable.GetTableRowCount() - 1);
@@ -630,7 +630,7 @@ namespace Game.Entities
if ((m_unitData.MinItemLevel != 0 || m_unitData.MaxItemLevel != 0) && pEnchant.ScalingClassRestricted != 0)
scalingClass = pEnchant.ScalingClassRestricted;
uint minLevel = pEnchant.GetFlags().HasFlag(SpellItemEnchantmentFlags.ScaleAsAGem) ? 1 : 60u;
uint minLevel = pEnchant.HasFlag(SpellItemEnchantmentFlags.ScaleAsAGem) ? 1 : 60u;
uint scalingLevel = GetLevel();
byte maxLevel = (byte)(pEnchant.MaxLevel != 0 ? pEnchant.MaxLevel : CliDB.SpellScalingGameTable.GetTableRowCount() - 1);
@@ -1660,7 +1660,7 @@ namespace Game.Entities
case AbilityLearnType.OnSkillLearn:
break;
case AbilityLearnType.RewardedFromQuest:
if (!ability.Flags.HasAnyFlag(SkillLineAbilityFlags.CanFallbackToLearnedOnSkillLearn) ||
if (!ability.HasFlag(SkillLineAbilityFlags.CanFallbackToLearnedOnSkillLearn) ||
!spellInfo.MeetsFutureSpellPlayerCondition(this))
continue;
break;
@@ -2089,7 +2089,7 @@ namespace Game.Entities
{
ushort skillValue = 1;
ushort maxValue = GetMaxSkillValueForLevel();
if (rcInfo.Flags.HasAnyFlag(SkillRaceClassInfoFlags.AlwaysMaxValue))
if (rcInfo.HasFlag(SkillRaceClassInfoFlags.AlwaysMaxValue))
skillValue = maxValue;
else if (GetClass() == Class.Deathknight)
skillValue = (ushort)Math.Min(Math.Max(1, (GetLevel() - 1) * 5), maxValue);
@@ -2105,7 +2105,7 @@ namespace Game.Entities
SkillTiersEntry tier = Global.ObjectMgr.GetSkillTier(rcInfo.SkillTierID);
ushort maxValue = (ushort)tier.GetValueForTierIndex(0);
ushort skillValue = 1;
if (rcInfo.Flags.HasAnyFlag(SkillRaceClassInfoFlags.AlwaysMaxValue))
if (rcInfo.HasFlag(SkillRaceClassInfoFlags.AlwaysMaxValue))
skillValue = maxValue;
else if (GetClass() == Class.Deathknight)
skillValue = (ushort)Math.Min(Math.Max(1, (GetLevel() - 1) * 5), maxValue);
@@ -2307,7 +2307,7 @@ namespace Game.Entities
break;
}
if (rcInfo.Flags.HasAnyFlag(SkillRaceClassInfoFlags.AlwaysMaxValue))
if (rcInfo.HasFlag(SkillRaceClassInfoFlags.AlwaysMaxValue))
skill_value = new_skill_max_value;
}
}
@@ -2815,7 +2815,7 @@ namespace Game.Entities
break;
}
if (rcInfo.Flags.HasAnyFlag(SkillRaceClassInfoFlags.AlwaysMaxValue))
if (rcInfo.HasFlag(SkillRaceClassInfoFlags.AlwaysMaxValue))
skill_value = new_skill_max_value;
}
}
+19 -19
View File
@@ -1471,7 +1471,7 @@ namespace Game.Entities
return;
// Check dynamic maximum flag
if (!currency.GetFlags().HasFlag(CurrencyTypesFlags.DynamicMaximum))
if (!currency.HasFlag(CurrencyTypesFlags.DynamicMaximum))
return;
// Ancient mana maximum cap
@@ -1562,7 +1562,7 @@ namespace Game.Entities
maxQuantity = (uint)WorldStateMgr.GetValue(currency.MaxQtyWorldStateID, GetMap());
uint increasedCap = 0;
if (currency.GetFlags().HasFlag(CurrencyTypesFlags.DynamicMaximum))
if (currency.HasFlag(CurrencyTypesFlags.DynamicMaximum))
increasedCap = GetCurrencyIncreasedCapQuantity(currency.Id);
return maxQuantity + increasedCap;
@@ -1727,7 +1727,7 @@ namespace Game.Entities
{
var friendshipReputation = CliDB.FriendshipReputationStorage.LookupByKey(factionEntry.FriendshipRepID);
if (friendshipReputation != null)
if (friendshipReputation.Flags.HasAnyFlag(FriendshipReputationFlags.NoRepGainModifiers))
if (friendshipReputation.HasFlag(FriendshipReputationFlags.NoRepGainModifiers))
noBonuses = true;
}
@@ -2188,7 +2188,7 @@ namespace Game.Entities
public uint GetStartLevel(Race race, Class playerClass, uint? characterTemplateId = null)
{
uint startLevel = WorldConfig.GetUIntValue(WorldCfg.StartPlayerLevel);
if (CliDB.ChrRacesStorage.LookupByKey(race).GetFlags().HasAnyFlag(ChrRacesFlag.IsAlliedRace))
if (CliDB.ChrRacesStorage.LookupByKey(race).HasFlag(ChrRacesFlag.IsAlliedRace))
startLevel = WorldConfig.GetUIntValue(WorldCfg.StartAlliedRaceLevel);
if (playerClass == Class.Deathknight)
@@ -2233,7 +2233,7 @@ namespace Game.Entities
}
});
if (m_unitMovedByMe.GetVehicleBase() == null || !m_unitMovedByMe.GetVehicle().GetVehicleInfo().Flags.HasAnyFlag(VehicleFlags.FixedPosition))
if (m_unitMovedByMe.GetVehicleBase() == null || !m_unitMovedByMe.GetVehicle().GetVehicleInfo().HasFlag(VehicleFlags.FixedPosition))
RemoveViolatingFlags(mi.HasMovementFlag(MovementFlag.Root), MovementFlag.Root);
/*! This must be a packet spoofing attempt. MOVEMENTFLAG_ROOT sent from the client is not valid
@@ -2966,19 +2966,19 @@ namespace Game.Entities
public bool CanJoinConstantChannelInZone(ChatChannelsRecord channel, AreaTableRecord zone)
{
if (channel.GetFlags().HasFlag(ChatChannelFlags.ZoneBased) && zone.GetFlags().HasFlag(AreaFlags.NoChatChannels))
if (channel.HasFlag(ChatChannelFlags.ZoneBased) && zone.HasFlag(AreaFlags.NoChatChannels))
return false;
if (channel.GetFlags().HasFlag(ChatChannelFlags.OnlyInCities) && !zone.GetFlags().HasFlag(AreaFlags.AllowTradeChannel))
if (channel.HasFlag(ChatChannelFlags.OnlyInCities) && !zone.HasFlag(AreaFlags.AllowTradeChannel))
return false;
if (channel.GetFlags().HasFlag(ChatChannelFlags.GuildRecruitment) && GetGuildId() != 0)
if (channel.HasFlag(ChatChannelFlags.GuildRecruitment) && GetGuildId() != 0)
return false;
if (channel.GetRuleset() == ChatChannelRuleset.Disabled)
return false;
if (channel.GetFlags().HasFlag(ChatChannelFlags.Regional))
if (channel.HasFlag(ChatChannelFlags.Regional))
return false;
return true;
@@ -3026,7 +3026,7 @@ namespace Game.Entities
foreach (var channelEntry in CliDB.ChatChannelsStorage.Values)
{
if (!channelEntry.GetFlags().HasFlag(ChatChannelFlags.AutoJoin))
if (!channelEntry.HasFlag(ChatChannelFlags.AutoJoin))
continue;
Channel usedChannel = null;
@@ -3045,9 +3045,9 @@ namespace Game.Entities
if (CanJoinConstantChannelInZone(channelEntry, current_zone))
{
if (!channelEntry.GetFlags().HasFlag(ChatChannelFlags.ZoneBased))
if (!channelEntry.HasFlag(ChatChannelFlags.ZoneBased))
{
if (channelEntry.GetFlags().HasFlag(ChatChannelFlags.LinkedChannel) && usedChannel != null)
if (channelEntry.HasFlag(ChatChannelFlags.LinkedChannel) && usedChannel != null)
continue; // Already on the channel, as city channel names are not changing
joinChannel = cMgr.GetSystemChannel(channelEntry.Id, current_zone);
@@ -3579,7 +3579,7 @@ namespace Game.Entities
if (!IsInCombat())
{
if (powerType.GetFlags().HasFlag(PowerTypeFlags.UseRegenInterrupt) && m_regenInterruptTimestamp + TimeSpan.FromMicroseconds(powerType.RegenInterruptTimeMS) >= GameTime.Now())
if (powerType.HasFlag(PowerTypeFlags.UseRegenInterrupt) && m_regenInterruptTimestamp + TimeSpan.FromMicroseconds(powerType.RegenInterruptTimeMS) >= GameTime.Now())
return;
addvalue = (powerType.RegenPeace + m_unitData.PowerRegenFlatModifier[(int)powerIndex]) * 0.001f * RegenTimer;
@@ -4447,7 +4447,7 @@ namespace Game.Entities
bool shouldResurrect = false;
// Such zones are considered unreachable as a ghost and the player must be automatically revived
if ((!IsAlive() && zone != null && zone.GetFlags().HasFlag(AreaFlags.NoGhostOnRelease)) || GetMap().IsNonRaidDungeon() || GetMap().IsRaid() || GetTransport() != null || GetPositionZ() < GetMap().GetMinHeight(GetPhaseShift(), GetPositionX(), GetPositionY()))
if ((!IsAlive() && zone != null && zone.HasFlag(AreaFlags.NoGhostOnRelease)) || GetMap().IsNonRaidDungeon() || GetMap().IsRaid() || GetTransport() != null || GetPositionZ() < GetMap().GetMinHeight(GetPhaseShift(), GetPositionX(), GetPositionY()))
{
shouldResurrect = true;
SpawnCorpseBones();
@@ -5064,7 +5064,7 @@ namespace Game.Entities
do
{
if (area.GetFlags2().HasFlag(AreaFlags2.AllowWarModeToggle))
if (area.HasFlag(AreaFlags2.AllowWarModeToggle))
return true;
area = CliDB.AreaTableStorage.LookupByKey(area.ParentAreaID);
@@ -5339,7 +5339,7 @@ namespace Game.Entities
// Only health and mana are set to maximum.
SetFullHealth();
foreach (PowerTypeRecord powerType in CliDB.PowerTypeStorage.Values)
if (powerType.GetFlags().HasFlag(PowerTypeFlags.SetToMaxOnLevelUp))
if (powerType.HasFlag(PowerTypeFlags.SetToMaxOnLevelUp))
SetFullPower(powerType.PowerTypeEnum);
// update level to hunter/summon pet
@@ -5655,7 +5655,7 @@ namespace Game.Entities
vignetteUpdate.ForceUpdate = true;
foreach (VignetteData vignette in GetMap().GetInfiniteAOIVignettes())
if (!vignette.Data.GetFlags().HasFlag(VignetteFlags.ZoneInfiniteAOI) && Vignettes.CanSee(this, vignette))
if (!vignette.Data.HasFlag(VignetteFlags.ZoneInfiniteAOI) && Vignettes.CanSee(this, vignette))
vignette.FillPacket(vignetteUpdate.Added);
SendPacket(vignetteUpdate);
@@ -5732,7 +5732,7 @@ namespace Game.Entities
{
Difficulty mapDifficulty = GetMap().GetDifficultyID();
var difficulty = CliDB.DifficultyStorage.LookupByKey(mapDifficulty);
SendRaidDifficulty((difficulty.Flags & DifficultyFlags.Legacy) != 0, (int)mapDifficulty);
SendRaidDifficulty(difficulty.HasFlag(DifficultyFlags.Legacy), (int)mapDifficulty);
}
else if (GetMap().IsNonRaidDungeon())
SendDungeonDifficulty((int)GetMap().GetDifficultyID());
@@ -7078,7 +7078,7 @@ namespace Game.Entities
// change but I couldn't find a suitable alternative. OK to use class because only DK
// can use this taxi.
uint mount_display_id;
if (node.GetFlags().HasFlag(TaxiNodeFlags.UsePlayerFavoriteMount) && preferredMountDisplay != 0)
if (node.HasFlag(TaxiNodeFlags.UsePlayerFavoriteMount) && preferredMountDisplay != 0)
mount_display_id = preferredMountDisplay;
else
mount_display_id = ObjectMgr.GetTaxiMountDisplayId(sourcenode, GetTeam(), npc == null || (sourcenode == 315 && GetClass() == Class.Deathknight));
+1 -1
View File
@@ -2107,7 +2107,7 @@ namespace Game.Entities
{
var powerType = Global.DB2Mgr.GetPowerTypeEntry(power);
if (powerType != null)
if (!powerType.GetFlags().HasFlag(PowerTypeFlags.IsUsedByNPCs))
if (!powerType.HasFlag(PowerTypeFlags.IsUsedByNPCs))
return 0;
return base.GetCreatePowerValue(power);
+2 -2
View File
@@ -59,7 +59,7 @@ namespace Game.Entities
for (int i = first + 1; i < last; ++i)
{
if (nodes[i - 1].Flags.HasAnyFlag(TaxiPathNodeFlags.Teleport))
if (nodes[i - 1].HasFlag(TaxiPathNodeFlags.Teleport))
continue;
int uiMap1, uiMap2;
@@ -155,7 +155,7 @@ namespace Game.Entities
{
var To = m_nodesByVertex[(int)edge.To];
TaxiNodeFlags requireFlag = (player.GetTeam() == Team.Alliance) ? TaxiNodeFlags.ShowOnAllianceMap : TaxiNodeFlags.ShowOnHordeMap;
if (!To.GetFlags().HasFlag(requireFlag))
if (!To.HasFlag(requireFlag))
continue;
PlayerConditionRecord condition = CliDB.PlayerConditionStorage.LookupByKey(To.ConditionID);
+3 -3
View File
@@ -215,18 +215,18 @@ namespace Game.Entities
unitSummoner.m_SummonSlot[slot] = GetGUID();
}
if (!m_Properties.GetFlags().HasFlag(SummonPropertiesFlags.UseCreatureLevel))
if (!m_Properties.HasFlag(SummonPropertiesFlags.UseCreatureLevel))
SetLevel(unitSummoner.GetLevel());
}
uint faction = m_Properties.Faction;
if (summoner != null && m_Properties.GetFlags().HasFlag(SummonPropertiesFlags.UseSummonerFaction)) // TODO: Determine priority between faction and flag
if (summoner != null && m_Properties.HasFlag(SummonPropertiesFlags.UseSummonerFaction)) // TODO: Determine priority between faction and flag
faction = summoner.GetFaction();
if (faction != 0)
SetFaction(faction);
if (m_Properties.GetFlags().HasFlag(SummonPropertiesFlags.SummonFromBattlePetJournal))
if (m_Properties.HasFlag(SummonPropertiesFlags.SummonFromBattlePetJournal))
RemoveNpcFlag(NPCFlags.WildBattlePet);
}
+2 -2
View File
@@ -474,7 +474,7 @@ namespace Game.Entities
mask = UnitTypeMask.Minion;
break;
default:
if (properties.GetFlags().HasFlag(SummonPropertiesFlags.JoinSummonerSpawnGroup)) // Mirror Image, Summon Gargoyle
if (properties.HasFlag(SummonPropertiesFlags.JoinSummonerSpawnGroup)) // Mirror Image, Summon Gargoyle
mask = UnitTypeMask.Guardian;
break;
}
@@ -513,7 +513,7 @@ namespace Game.Entities
return null;
WorldObject phaseShiftOwner = this;
if (summoner != null && !(properties != null && properties.GetFlags().HasFlag(SummonPropertiesFlags.IgnoreSummonerPhase)))
if (summoner != null && !(properties != null && properties.HasFlag(SummonPropertiesFlags.IgnoreSummonerPhase)))
phaseShiftOwner = summoner;
if (phaseShiftOwner != null)
+9 -9
View File
@@ -820,15 +820,15 @@ namespace Game.Entities
if (ridingSkill < mountCapability.ReqRidingSkill)
continue;
if (!mountCapability.Flags.HasAnyFlag(MountCapabilityFlags.IgnoreRestrictions))
if (!mountCapability.HasFlag(MountCapabilityFlags.IgnoreRestrictions))
{
if (mountCapability.Flags.HasAnyFlag(MountCapabilityFlags.Ground) && !mountFlags.HasFlag(AreaMountFlags.AllowGroundMounts))
if (mountCapability.HasFlag(MountCapabilityFlags.Ground) && !mountFlags.HasFlag(AreaMountFlags.AllowGroundMounts))
continue;
if (mountCapability.Flags.HasAnyFlag(MountCapabilityFlags.Flying) && !mountFlags.HasFlag(AreaMountFlags.AllowFlyingMounts))
if (mountCapability.HasFlag(MountCapabilityFlags.Flying) && !mountFlags.HasFlag(AreaMountFlags.AllowFlyingMounts))
continue;
if (mountCapability.Flags.HasAnyFlag(MountCapabilityFlags.Float) && !mountFlags.HasFlag(AreaMountFlags.AllowSurfaceSwimmingMounts))
if (mountCapability.HasFlag(MountCapabilityFlags.Float) && !mountFlags.HasFlag(AreaMountFlags.AllowSurfaceSwimmingMounts))
continue;
if (mountCapability.Flags.HasAnyFlag(MountCapabilityFlags.Underwater) && !mountFlags.HasFlag(AreaMountFlags.AllowUnderwaterSwimmingMounts))
if (mountCapability.HasFlag(MountCapabilityFlags.Underwater) && !mountFlags.HasFlag(AreaMountFlags.AllowUnderwaterSwimmingMounts))
continue;
}
@@ -837,19 +837,19 @@ namespace Game.Entities
if (!isInWater)
{
// player is completely out of water
if (!mountCapability.Flags.HasAnyFlag(MountCapabilityFlags.Ground))
if (!mountCapability.HasFlag(MountCapabilityFlags.Ground))
continue;
}
// player is on water surface
else if (!mountCapability.Flags.HasAnyFlag(MountCapabilityFlags.Float))
else if (!mountCapability.HasFlag(MountCapabilityFlags.Float))
continue;
}
else if (isInWater)
{
if (!mountCapability.Flags.HasAnyFlag(MountCapabilityFlags.Underwater))
if (!mountCapability.HasFlag(MountCapabilityFlags.Underwater))
continue;
}
else if (!mountCapability.Flags.HasAnyFlag(MountCapabilityFlags.Float))
else if (!mountCapability.HasFlag(MountCapabilityFlags.Float))
continue;
if (mountCapability.ReqMapID != -1 &&
+1 -1
View File
@@ -146,7 +146,7 @@ namespace Game.Entities
Player thisPlayer = ToPlayer();
if (thisPlayer != null)
{
if (properties.GetFlags().HasFlag(SummonPropertiesFlags.SummonFromBattlePetJournal))
if (properties.HasFlag(SummonPropertiesFlags.SummonFromBattlePetJournal))
{
var pet = thisPlayer.GetSession().GetBattlePetMgr().GetPet(thisPlayer.GetSummonedBattlePetGUID());
if (pet != null)
+1 -1
View File
@@ -1211,7 +1211,7 @@ namespace Game.Entities
{
var powerTypeEntry = Global.DB2Mgr.GetPowerTypeEntry(powerType);
if (powerTypeEntry != null)
if (powerTypeEntry.GetFlags().HasFlag(PowerTypeFlags.UseRegenInterrupt))
if (powerTypeEntry.HasFlag(PowerTypeFlags.UseRegenInterrupt))
player.InterruptPowerRegen(powerType);
}
+4 -4
View File
@@ -299,7 +299,7 @@ namespace Game.Entities
if (shapeshift == null)
return true;
if (!shapeshift.Flags.HasAnyFlag(SpellShapeshiftFormFlags.Stance))
if (!shapeshift.HasFlag(SpellShapeshiftFormFlags.Stance))
return true;
}
if (displayId == GetNativeDisplayId())
@@ -316,8 +316,8 @@ namespace Game.Entities
CreatureModelDataRecord model = CliDB.CreatureModelDataStorage.LookupByKey(display.ModelID);
ChrRacesRecord race = CliDB.ChrRacesStorage.LookupByKey(displayExtra.DisplayRaceID);
if (model != null && !model.GetFlags().HasFlag(CreatureModelDataFlags.CanMountWhileTransformedAsThis))
if (race != null && !race.GetFlags().HasFlag(ChrRacesFlag.CanMount))
if (model != null && !model.HasFlag(CreatureModelDataFlags.CanMountWhileTransformedAsThis))
if (race != null && !race.HasFlag(ChrRacesFlag.CanMount))
return true;
return false;
@@ -1594,7 +1594,7 @@ namespace Game.Entities
SetEmoteState(Emote.OneshotNone);
SetStandState(UnitStandStateType.Stand);
if (m_vignette != null && !m_vignette.Data.GetFlags().HasFlag(VignetteFlags.PersistsThroughDeath))
if (m_vignette != null && !m_vignette.Data.HasFlag(VignetteFlags.PersistsThroughDeath))
SetVignette(0);
// players in instance don't have ZoneScript, but they have InstanceScript
+1 -1
View File
@@ -102,7 +102,7 @@ namespace Game.Entities
public static bool CanSee(Player player, VignetteData vignette)
{
if (vignette.Data.GetFlags().HasFlag(VignetteFlags.ZoneInfiniteAOI))
if (vignette.Data.HasFlag(VignetteFlags.ZoneInfiniteAOI))
if (vignette.ZoneID != player.GetZoneId())
return false;