aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells/SpellMgr.cpp
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2022-02-10 12:25:27 +0100
committerShauren <shauren.trinity@gmail.com>2022-02-10 12:25:27 +0100
commit68a662ae04ce5fd6378793925f955e23fff99a6b (patch)
treec22fc4ab4cadabf3c65d3a62df72350e54a300c0 /src/server/game/Spells/SpellMgr.cpp
parentf4cf0ecad6fd8a908e7140cdad82d5d5fdce3753 (diff)
Core/Spells: Add type safety to proc related functions - using enum arguments instead of plain integers
Diffstat (limited to 'src/server/game/Spells/SpellMgr.cpp')
-rw-r--r--src/server/game/Spells/SpellMgr.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp
index 64533be0a58..864985a6444 100644
--- a/src/server/game/Spells/SpellMgr.cpp
+++ b/src/server/game/Spells/SpellMgr.cpp
@@ -1520,7 +1520,7 @@ void SpellMgr::LoadSpellProcs()
SpellProcEntry baseProcEntry;
- baseProcEntry.SchoolMask = fields[1].GetInt8();
+ baseProcEntry.SchoolMask = fields[1].GetUInt8();
baseProcEntry.SpellFamilyName = fields[2].GetUInt16();
baseProcEntry.SpellFamilyMask[0] = fields[3].GetUInt32();
baseProcEntry.SpellFamilyMask[1] = fields[4].GetUInt32();
@@ -1528,10 +1528,10 @@ void SpellMgr::LoadSpellProcs()
baseProcEntry.SpellFamilyMask[3] = fields[6].GetUInt32();
baseProcEntry.ProcFlags[0] = fields[7].GetUInt32();
baseProcEntry.ProcFlags[1] = fields[8].GetUInt32();
- baseProcEntry.SpellTypeMask = fields[9].GetUInt32();
- baseProcEntry.SpellPhaseMask = fields[10].GetUInt32();
- baseProcEntry.HitMask = fields[11].GetUInt32();
- baseProcEntry.AttributesMask = fields[12].GetUInt32();
+ baseProcEntry.SpellTypeMask = ProcFlagsSpellType(fields[9].GetUInt32());
+ baseProcEntry.SpellPhaseMask = ProcFlagsSpellPhase(fields[10].GetUInt32());
+ baseProcEntry.HitMask = ProcFlagsHit(fields[11].GetUInt32());
+ baseProcEntry.AttributesMask = ProcAttributes(fields[12].GetUInt32());
baseProcEntry.DisableEffectsMask = fields[13].GetUInt32();
baseProcEntry.ProcsPerMinute = fields[14].GetFloat();
baseProcEntry.Chance = fields[15].GetFloat();
@@ -1637,7 +1637,7 @@ void SpellMgr::LoadSpellProcs()
// Triggered always, even from triggered spells
bool isAlwaysTriggeredAura[TOTAL_AURAS];
// SpellTypeMask to add to the proc
- uint32 spellTypeMask[TOTAL_AURAS];
+ ProcFlagsSpellType spellTypeMask[TOTAL_AURAS];
// List of auras that CAN trigger but may not exist in spell_proc
// in most cases needed to drop charges
@@ -1738,7 +1738,7 @@ void SpellMgr::LoadSpellProcs()
continue;
bool addTriggerFlag = false;
- uint32 procSpellTypeMask = PROC_SPELL_TYPE_NONE;
+ ProcFlagsSpellType procSpellTypeMask = PROC_SPELL_TYPE_NONE;
uint32 nonProcMask = 0;
for (SpellEffectInfo const& spellEffectInfo : spellInfo.GetEffects())
{
@@ -1837,7 +1837,7 @@ void SpellMgr::LoadSpellProcs()
break;
}
- procEntry.AttributesMask = 0;
+ procEntry.AttributesMask = PROC_ATTR_NONE;
procEntry.DisableEffectsMask = nonProcMask;
if (spellInfo.ProcFlags & PROC_FLAG_KILL)
procEntry.AttributesMask |= PROC_ATTR_REQ_EXP_OR_HONOR;