Core/Misc: Minor compile time improving changes

Port From (https://github.com/TrinityCore/TrinityCore/commit/b5c99939a82ed956cd185cd7a2ede838e2fdf23e)
This commit is contained in:
Hondacrx
2025-08-13 22:02:34 -04:00
parent f6c56c3293
commit 442e7dcde2
5 changed files with 79 additions and 83 deletions
+2 -38
View File
@@ -47,25 +47,7 @@ namespace Game.Entities
{
var addionalData = additionalData.LookupByKey(item.GetGUID().GetCounter());
if (addionalData != null)
{
if (item.GetTemplate().GetArtifactID() != 0 && addionalData.Artifact != null)
item.LoadArtifactData(this, addionalData.Artifact.Xp, addionalData.Artifact.ArtifactAppearanceId, addionalData.Artifact.ArtifactTierId, addionalData.Artifact.ArtifactPowers);
if (addionalData.AzeriteItem != null)
{
AzeriteItem azeriteItem = item.ToAzeriteItem();
if (azeriteItem != null)
azeriteItem.LoadAzeriteItemData(this, addionalData.AzeriteItem);
}
if (addionalData.AzeriteEmpoweredItem != null)
{
AzeriteEmpoweredItem azeriteEmpoweredItem = item.ToAzeriteEmpoweredItem();
if (azeriteEmpoweredItem != null)
azeriteEmpoweredItem.LoadAzeriteEmpoweredItemData(this, addionalData.AzeriteEmpoweredItem);
}
}
item.LoadAdditionalDataFromDB(this, addionalData);
ulong dbId = result.Read<ulong>(52);
ObjectGuid bagGuid = dbId != 0 ? ObjectGuid.Create(HighGuid.Item, dbId) : ObjectGuid.Empty;
@@ -1432,25 +1414,7 @@ namespace Game.Entities
}
if (addionalData != null)
{
if (item.GetTemplate().GetArtifactID() != 0 && addionalData.Artifact != null)
item.LoadArtifactData(player, addionalData.Artifact.Xp, addionalData.Artifact.ArtifactAppearanceId,
addionalData.Artifact.ArtifactTierId, addionalData.Artifact.ArtifactPowers);
if (addionalData.AzeriteItem != null)
{
AzeriteItem azeriteItem = item.ToAzeriteItem();
if (azeriteItem != null)
azeriteItem.LoadAzeriteItemData(player, addionalData.AzeriteItem);
}
if (addionalData.AzeriteEmpoweredItem != null)
{
AzeriteEmpoweredItem azeriteEmpoweredItem = item.ToAzeriteEmpoweredItem();
if (azeriteEmpoweredItem != null)
azeriteEmpoweredItem.LoadAzeriteEmpoweredItemData(player, addionalData.AzeriteEmpoweredItem);
}
}
item.LoadAdditionalDataFromDB(player, addionalData);
if (mail != null)
mail.AddItem(itemGuid, itemEntry);
+1 -25
View File
@@ -3346,31 +3346,7 @@ namespace Game.Entities
}
}
UpdateItemSetAuras(true);
}
void UpdateItemSetAuras(bool formChange = false)
{
// item set bonuses not dependent from item broken state
for (int setindex = 0; setindex < ItemSetEff.Count; ++setindex)
{
ItemSetEffect eff = ItemSetEff[setindex];
if (eff == null)
continue;
foreach (ItemSetSpellRecord itemSetSpell in eff.SetBonuses)
{
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(itemSetSpell.SpellID, Difficulty.None);
if (itemSetSpell.ChrSpecID != 0 && (ChrSpecialization)itemSetSpell.ChrSpecID != GetPrimarySpecialization())
ApplyEquipSpell(spellInfo, null, false, false); // item set aura is not for current spec
else
{
ApplyEquipSpell(spellInfo, null, false, formChange); // remove spells that not fit to form - removal is skipped if shapeshift condition is satisfied
ApplyEquipSpell(spellInfo, null, true, formChange); // add spells that fit form but not active
}
}
}
Item.UpdateItemSetAuras(this, true);
}
public int GetSpellPenetrationItemMod() { return m_spellPenetrationItemMod; }
@@ -232,7 +232,7 @@ namespace Game.Entities
LearnSpecializationSpells();
SendTalentsInfoData();
UpdateItemSetAuras(false);
Item.UpdateItemSetAuras(this, false);
}
bool HasTalent(uint talentId, byte group)
@@ -422,7 +422,7 @@ namespace Game.Entities
SetPower(PowerType.Mana, 0); // Mana must be 0 even if it isn't the active power type.
SetPower(pw, 0);
UpdateItemSetAuras(false);
Item.UpdateItemSetAuras(this, false);
// update visible transmog
for (byte i = EquipmentSlot.Start; i < EquipmentSlot.End; ++i)