Fix sign issue with hate redux spells

This commit is contained in:
Michael Cook (mackal) 2015-04-10 03:06:05 -04:00
parent 0d4775a9df
commit ea240f7814

View File

@ -82,6 +82,7 @@ Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
#include <assert.h> #include <assert.h>
#include <math.h> #include <math.h>
#include <algorithm>
#ifndef WIN32 #ifndef WIN32
#include <stdlib.h> #include <stdlib.h>
@ -3674,17 +3675,11 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r
if (aggro > 0) { if (aggro > 0) {
if (!IsHarmonySpell(spell_id)) if (!IsHarmonySpell(spell_id))
spelltar->AddToHateList(this, aggro); spelltar->AddToHateList(this, aggro);
else else if (!spelltar->PassCharismaCheck(this, spell_id))
if(!spelltar->PassCharismaCheck(this, spell_id))
spelltar->AddToHateList(this, aggro); spelltar->AddToHateList(this, aggro);
}
else{
uint32 newhate = spelltar->GetHateAmount(this) + aggro;
if (newhate < 1) {
spelltar->SetHateAmountOnEnt(this,1);
} else { } else {
spelltar->SetHateAmountOnEnt(this,newhate); int newhate = spelltar->GetHateAmount(this) + aggro;
} spelltar->SetHateAmountOnEnt(this, std::max(1, newhate));
} }
} }