cache SpellSpecific and AuraState information instead of computing them each time they're needed

This commit is contained in:
hondacrx
2017-09-01 10:40:48 -04:00
parent a710308c13
commit 6421672adc
8 changed files with 104 additions and 113 deletions
+17
View File
@@ -2790,6 +2790,9 @@ namespace Game.Entities
case 42767: // Sic'em
spellInfo.GetEffect(0).TargetA = new SpellImplicitTargetInfo(Targets.UnitNearbyEntry);
break;
case 42793: // Burn Body
spellInfo.GetEffect(2).MiscValue = 24008; // Fallen Combatant
break;
// VIOLET HOLD SPELLS
//
case 54258: // Water Globule (Ichoron)
@@ -3095,6 +3098,20 @@ namespace Game.Entities
Log.outInfo(LogFilter.ServerLoading, "Loaded SpellInfo corrections in {0} ms", Time.GetMSTimeDiffToNow(oldMSTime));
}
public void LoadSpellInfoSpellSpecificAndAuraState()
{
uint oldMSTime = Time.GetMSTime();
foreach (SpellInfo spellInfo in mSpellInfoMap.Values)
{
// AuraState depends on SpellSpecific
spellInfo._LoadSpellSpecific();
spellInfo._LoadAuraState();
}
Log.outInfo(LogFilter.ServerLoading, $"Loaded SpellInfo SpellSpecific and AuraState in {Time.GetMSTimeDiffToNow(oldMSTime)} ms");
}
public void LoadPetFamilySpellsStore()
{
Dictionary<uint, SpellLevelsRecord> levelsBySpell = new Dictionary<uint, SpellLevelsRecord>();