Core/Misc: Turn ChrSpecialization into enum

Port From (https://github.com/TrinityCore/TrinityCore/commit/98007f859b7318570c0c923a00aa32fc485c8ec8)
This commit is contained in:
hondacrx
2023-09-13 20:33:47 -04:00
parent a8e62cc07d
commit 3052b1dc23
25 changed files with 69 additions and 56 deletions
+4 -4
View File
@@ -1137,7 +1137,7 @@ namespace Game.Entities
int activeConfig = m_activePlayerData.TraitConfigs.FindIndexIf(traitConfig =>
{
return traitConfig.Type == (int)TraitConfigType.Combat
&& traitConfig.ChrSpecializationID == GetPrimarySpecialization()
&& traitConfig.ChrSpecializationID == (int)GetPrimarySpecialization()
&& (traitConfig.CombatConfigFlags & (int)TraitCombatConfigFlags.ActiveForSpec) != 0;
});
@@ -3321,7 +3321,7 @@ namespace Game.Entities
SetNumRespecs(numRespecs);
SetPrimarySpecialization(primarySpecialization);
SetActiveTalentGroup(activeTalentGroup);
ChrSpecializationRecord primarySpec = CliDB.ChrSpecializationStorage.LookupByKey(GetPrimarySpecialization());
ChrSpecializationRecord primarySpec = GetPrimarySpecializationEntry();
if (primarySpec == null || primarySpec.ClassID != (byte)GetClass() || GetActiveTalentGroup() >= PlayerConst.MaxSpecializations)
ResetTalentSpecialization();
@@ -3676,7 +3676,7 @@ namespace Game.Entities
//save, but in tavern/city
stmt.AddValue(index++, GetTalentResetCost());
stmt.AddValue(index++, GetTalentResetTime());
stmt.AddValue(index++, GetPrimarySpecialization());
stmt.AddValue(index++, (uint)GetPrimarySpecialization());
stmt.AddValue(index++, (ushort)m_ExtraFlags);
stmt.AddValue(index++, 0); // summonedPetNumber
stmt.AddValue(index++, (ushort)atLoginFlags);
@@ -3806,7 +3806,7 @@ namespace Game.Entities
stmt.AddValue(index++, GetTalentResetCost());
stmt.AddValue(index++, GetTalentResetTime());
stmt.AddValue(index++, GetNumRespecs());
stmt.AddValue(index++, GetPrimarySpecialization());
stmt.AddValue(index++, (uint)GetPrimarySpecialization());
stmt.AddValue(index++, (ushort)m_ExtraFlags);
PetStable petStable = GetPetStable();
if (petStable != null)