diff options
| author | QAston <none@none> | 2009-02-19 00:27:30 +0100 |
|---|---|---|
| committer | QAston <none@none> | 2009-02-19 00:27:30 +0100 |
| commit | 13fd0ed366d250c59b46825628e0507e6dc21489 (patch) | |
| tree | ed2d4eab5563aa63f52489b9d8295fdd3602e9a7 /src/game/Unit.cpp | |
| parent | d344d4b6e9f6fef6592405ecf039b400fad55162 (diff) | |
*Try to fix enormous amount of some ap related spells. This may not fix all issues.
--HG--
branch : trunk
Diffstat (limited to 'src/game/Unit.cpp')
| -rw-r--r-- | src/game/Unit.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
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 ; } } |
