diff options
| author | QAston <none@none> | 2009-02-07 20:03:56 +0100 |
|---|---|---|
| committer | QAston <none@none> | 2009-02-07 20:03:56 +0100 |
| commit | 8a1b07e9c7259c1c426a3e1015df4cdf0c718c9b (patch) | |
| tree | 5c4941fab8ffa2f79c4ec097baeda721ec78e672 /src | |
| parent | ffd2f71f4bf67833423dfe87f0d3550750ab2011 (diff) | |
*Fix Expose Weakness and similar auras.
--HG--
branch : trunk
Diffstat (limited to 'src')
| -rw-r--r-- | src/game/Unit.cpp | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index f4253d8e97b..bc026849496 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -10366,13 +10366,23 @@ Powers Unit::GetPowerTypeByAuraGroup(UnitMods unitMod) const float Unit::GetTotalAttackPowerValue(WeaponAttackType attType) const { - UnitMods unitMod = (attType == RANGED_ATTACK) ? UNIT_MOD_ATTACK_POWER_RANGED : UNIT_MOD_ATTACK_POWER; - - float val = GetTotalAuraModValue(unitMod); - if(val < 0.0f) - val = 0.0f; +//get value from unit field instead of calculating from mods-because mods from stat are not added to unit_mods + int32 index, index_mod, index_mult; + if (attType == RANGED_ATTACK) + { + index=UNIT_FIELD_RANGED_ATTACK_POWER; + index_mod=UNIT_FIELD_RANGED_ATTACK_POWER_MODS; + index_mult=UNIT_FIELD_RANGED_ATTACK_POWER_MULTIPLIER; + } + else //meele + { + index=UNIT_FIELD_ATTACK_POWER; + index_mod=UNIT_FIELD_ATTACK_POWER_MODS; + index_mult=UNIT_FIELD_ATTACK_POWER_MULTIPLIER; + } - return val; + float val = float(GetUInt32Value(index) + GetUInt32Value(index_mod)) * float(GetFloatValue(index_mult)+1); + return (val < 0.0f)? 0.0f : val; } float Unit::GetWeaponDamageRange(WeaponAttackType attType ,WeaponDamageRange type) const |
