Switch NUMHIT_ enum to a strongly typed enum

This commit is contained in:
Michael Cook (mackal)
2015-01-17 16:18:09 -05:00
parent 7547d7610f
commit f9a7da61b8
7 changed files with 46 additions and 42 deletions
+7 -7
View File
@@ -5645,7 +5645,7 @@ int16 NPC::GetFocusEffect(focusType type, uint16 spell_id) {
return realTotal + realTotal2;
}
void Mob::CheckNumHitsRemaining(uint8 type, int32 buff_slot, uint16 spell_id)
void Mob::CheckNumHitsRemaining(NumHit type, int32 buff_slot, uint16 spell_id)
{
/*
Field 175 = numhits type
@@ -5672,7 +5672,7 @@ void Mob::CheckNumHitsRemaining(uint8 type, int32 buff_slot, uint16 spell_id)
if (IsValidSpell(spell_id)) {
for (int d = 0; d < buff_max; d++) {
if (buffs[d].spellid == spell_id && buffs[d].numhits > 0 &&
spells[buffs[d].spellid].numhitstype == type) {
spells[buffs[d].spellid].numhitstype == static_cast<int>(type)) {
if (--buffs[d].numhits == 0) {
CastOnNumHitFade(buffs[d].spellid);
if (!TryFadeEffect(d))
@@ -5682,7 +5682,7 @@ void Mob::CheckNumHitsRemaining(uint8 type, int32 buff_slot, uint16 spell_id)
}
}
}
} else if (type == NUMHIT_MatchingSpells) {
} else if (type == NumHit::MatchingSpells) {
if (buff_slot >= 0) {
if (--buffs[buff_slot].numhits == 0) {
CastOnNumHitFade(buffs[buff_slot].spellid);
@@ -5711,7 +5711,7 @@ void Mob::CheckNumHitsRemaining(uint8 type, int32 buff_slot, uint16 spell_id)
} else {
for (int d = 0; d < buff_max; d++) {
if (IsValidSpell(buffs[d].spellid) && buffs[d].numhits > 0 &&
spells[buffs[d].spellid].numhitstype == type) {
spells[buffs[d].spellid].numhitstype == static_cast<int>(type)) {
if (--buffs[d].numhits == 0) {
CastOnNumHitFade(buffs[d].spellid);
if (!TryFadeEffect(d))
@@ -5975,7 +5975,7 @@ int32 Mob::GetFcDamageAmtIncoming(Mob *caster, uint32 spell_id, bool use_skill,
}
if ((!limit_exists) || (limit_exists && skill_found)){
dmg += temp_dmg;
CheckNumHitsRemaining(NUMHIT_MatchingSpells,i);
CheckNumHitsRemaining(NumHit::MatchingSpells, i);
}
}
@@ -5983,7 +5983,7 @@ int32 Mob::GetFcDamageAmtIncoming(Mob *caster, uint32 spell_id, bool use_skill,
int32 focus = caster->CalcFocusEffect(focusFcDamageAmtIncoming, buffs[i].spellid, spell_id);
if(focus){
dmg += focus;
CheckNumHitsRemaining(NUMHIT_MatchingSpells,i);
CheckNumHitsRemaining(NumHit::MatchingSpells, i);
}
}
}
@@ -6035,7 +6035,7 @@ int32 Mob::GetFocusIncoming(focusType type, int effect, Mob *caster, uint32 spel
value = tmp_focus;
if (tmp_buffslot >= 0)
CheckNumHitsRemaining(NUMHIT_MatchingSpells, tmp_buffslot);
CheckNumHitsRemaining(NumHit::MatchingSpells, tmp_buffslot);
}