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

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
SeT 2009-07-12 00:15:07 +04:00 committed by VladimirMangos
parent 0dc7ea6cc2
commit e6d40697a1
3 changed files with 19 additions and 28 deletions

View file

@ -3815,17 +3815,14 @@ void Aura::HandleModThreat(bool apply, bool Real)
multiplier = 1;
break;
}
if (level_diff > 0)
m_modifier.m_amount += multiplier * level_diff;
for(int8 x=0;x < MAX_SPELL_SCHOOL;x++)
{
if(m_modifier.m_miscvalue & int32(1<<x))
{
if (m_target->GetTypeId() == TYPEID_PLAYER)
ApplyPercentModFloatVar(m_target->m_threatModifier[x], m_positive ? m_modifier.m_amount : -m_modifier.m_amount, apply);
}
}
for(int8 x=0;x < MAX_SPELL_SCHOOL;x++)
if (m_modifier.m_miscvalue & int32(1<<x))
ApplyPercentModFloatVar(m_target->m_threatModifier[x], m_modifier.m_amount, apply);
}
void Aura::HandleAuraModTotalThreat(bool apply, bool Real)
@ -3842,11 +3839,7 @@ void Aura::HandleAuraModTotalThreat(bool apply, bool Real)
if (!caster || !caster->isAlive())
return;
float threatMod = 0.0f;
if(apply)
threatMod = float(m_modifier.m_amount);
else
threatMod = float(-m_modifier.m_amount);
float threatMod = apply ? float(m_modifier.m_amount) : float(-m_modifier.m_amount);
m_target->getHostilRefManager().threatAssist(caster, threatMod);
}

View file

@ -33,10 +33,8 @@
float ThreatCalcHelper::calcThreat(Unit* pHatedUnit, Unit* pHatingUnit, float pThreat, SpellSchoolMask schoolMask, SpellEntry const *pThreatSpell)
{
if (pThreatSpell)
{
if( Player* modOwner = pHatingUnit->GetSpellModOwner() )
if (Player* modOwner = pHatedUnit->GetSpellModOwner())
modOwner->ApplySpellMod(pThreatSpell->Id, SPELLMOD_THREAT, pThreat);
}
float threat = pHatedUnit->ApplyTotalThreatModifier(pThreat, schoolMask);
return threat;

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "8162"
#define REVISION_NR "8163"
#endif // __REVISION_NR_H__