aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/game/SpellEffects.cpp2
-rw-r--r--src/game/Unit.cpp12
2 files changed, 5 insertions, 9 deletions
diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index 73677ccc15f..1686c8b607f 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -2264,7 +2264,7 @@ void Spell::EffectApplyAura(uint32 i)
//mod duration of channeled aura by spell haste
if (IsChanneledSpell(m_spellInfo))
- m_caster->ModSpellCastTime(m_spellInfo, duration);
+ caster->ModSpellCastTime(m_spellInfo, duration);
// if Aura removed and deleted, do not continue.
if(duration== 0 && !(Aur->IsPermanent()))
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 473be9e88a6..8863f5b19f6 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -10459,17 +10459,13 @@ float Unit::GetTotalAttackPowerValue(WeaponAttackType attType) const
{
if (attType == RANGED_ATTACK)
{
- int32 ap = GetInt32Value(UNIT_FIELD_RANGED_ATTACK_POWER) + GetInt32Value(UNIT_FIELD_RANGED_ATTACK_POWER_MODS);
- if (ap < 0)
- return 0.0f;
- return ap * (1.0f + GetFloatValue(UNIT_FIELD_RANGED_ATTACK_POWER_MULTIPLIER));
+ float ap = (1.0f + GetFloatValue(UNIT_FIELD_RANGED_ATTACK_POWER_MULTIPLIER)) * float(GetInt32Value(UNIT_FIELD_RANGED_ATTACK_POWER) + GetInt32Value(UNIT_FIELD_RANGED_ATTACK_POWER_MODS));
+ return ap < 0.0f ? 0.0f : ap ;
}
else
{
- int32 ap = GetInt32Value(UNIT_FIELD_ATTACK_POWER) + GetInt32Value(UNIT_FIELD_ATTACK_POWER_MODS);
- if (ap < 0)
- return 0.0f;
- return ap * (1.0f + GetFloatValue(UNIT_FIELD_ATTACK_POWER_MULTIPLIER));
+ float ap = (1.0f + GetFloatValue(UNIT_FIELD_ATTACK_POWER_MULTIPLIER)) * float(GetInt32Value(UNIT_FIELD_ATTACK_POWER) + GetInt32Value(UNIT_FIELD_ATTACK_POWER_MODS));
+ return ap < 0.0f ? 0.0f : ap ;
}
}