[8163] Fixed typo and wrong check affecting threat calculation. Author: SeT

--HG--
branch : trunk
This commit is contained in:
megamage
2009-07-12 18:06:19 +08:00
parent 721782b259
commit 8fedc832e8
2 changed files with 15 additions and 24 deletions
+4 -11
View File
@@ -4142,18 +4142,15 @@ void AuraEffect::HandleModThreat(bool apply, bool Real, bool changeAmount)
multiplier = 1; multiplier = 1;
break; break;
} }
if (level_diff > 0) if (level_diff > 0)
m_amount += multiplier * level_diff; m_amount += multiplier * level_diff;
for(int8 x=0;x < MAX_SPELL_SCHOOL;x++)
{
if(GetMiscValue() & int32(1<<x))
{
if (m_target->GetTypeId() == TYPEID_PLAYER) if (m_target->GetTypeId() == TYPEID_PLAYER)
for(int8 x=0;x < MAX_SPELL_SCHOOL;x++)
if (GetMiscValue() & int32(1<<x))
ApplyPercentModFloatVar(m_target->m_threatModifier[x], m_amount, apply); ApplyPercentModFloatVar(m_target->m_threatModifier[x], m_amount, apply);
} }
}
}
void AuraEffect::HandleAuraModTotalThreat(bool apply, bool Real, bool changeAmount) void AuraEffect::HandleAuraModTotalThreat(bool apply, bool Real, bool changeAmount)
{ {
@@ -4169,11 +4166,7 @@ void AuraEffect::HandleAuraModTotalThreat(bool apply, bool Real, bool changeAmou
if (!caster || !caster->isAlive()) if (!caster || !caster->isAlive())
return; return;
float threatMod = 0.0f; float threatMod = apply ? float(m_amount) : float(-m_amount);
if(apply)
threatMod = float(m_amount);
else
threatMod = float(-m_amount);
m_target->getHostilRefManager().threatAssist(caster, threatMod); m_target->getHostilRefManager().threatAssist(caster, threatMod);
} }
-2
View File
@@ -35,10 +35,8 @@
float ThreatCalcHelper::calcThreat(Unit* pHatedUnit, Unit* pHatingUnit, float pThreat, SpellSchoolMask schoolMask, SpellEntry const *pThreatSpell) float ThreatCalcHelper::calcThreat(Unit* pHatedUnit, Unit* pHatingUnit, float pThreat, SpellSchoolMask schoolMask, SpellEntry const *pThreatSpell)
{ {
if (pThreatSpell) if (pThreatSpell)
{
if (Player* modOwner = pHatedUnit->GetSpellModOwner()) if (Player* modOwner = pHatedUnit->GetSpellModOwner())
modOwner->ApplySpellMod(pThreatSpell->Id, SPELLMOD_THREAT, pThreat); modOwner->ApplySpellMod(pThreatSpell->Id, SPELLMOD_THREAT, pThreat);
}
float threat = pHatedUnit->ApplyTotalThreatModifier(pThreat, schoolMask); float threat = pHatedUnit->ApplyTotalThreatModifier(pThreat, schoolMask);
return threat; return threat;