diff options
author | megamage <none@none> | 2009-02-03 15:05:04 -0600 |
---|---|---|
committer | megamage <none@none> | 2009-02-03 15:05:04 -0600 |
commit | 3b8bce566ec9d3e56e35ebc3c3a0e9136faabdc6 (patch) | |
tree | d6c99472398f57257198200f1599952d000619bf /src/game/StatSystem.cpp | |
parent | 7fdb40ec5cfe99ad97d8c0768538d7a7b60016d8 (diff) | |
parent | 516cb0c6da103f2e5297beab80a19dfc88ffb4af (diff) |
*Merge.
--HG--
branch : trunk
Diffstat (limited to 'src/game/StatSystem.cpp')
-rw-r--r-- | src/game/StatSystem.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/game/StatSystem.cpp b/src/game/StatSystem.cpp index 5473206e8bd..8f520125986 100644 --- a/src/game/StatSystem.cpp +++ b/src/game/StatSystem.cpp @@ -427,8 +427,15 @@ void Player::CalculateMinMaxDamage(WeaponAttackType attType, bool normalized, fl weapon_mindamage = lvl*0.85*att_speed; weapon_maxdamage = lvl*1.25*att_speed; } - else if(!IsUseEquipedWeapon(attType==BASE_ATTACK)) //check if player not in form but still can't use weapon (broken/etc) + else if(!CanUseAttackType(attType)) //check if player not in form but still can't use (disarm case) { + //cannot use ranged/off attack, set values to 0 + if (attType != BASE_ATTACK) + { + min_damage=0; + max_damage=0; + return; + } weapon_mindamage = BASE_MINDAMAGE; weapon_maxdamage = BASE_MAXDAMAGE; } @@ -820,7 +827,7 @@ void Creature::UpdateDamagePhysical(WeaponAttackType attType) float total_value = GetModifierValue(unitMod, TOTAL_VALUE); float total_pct = GetModifierValue(unitMod, TOTAL_PCT); - if(attType == BASE_ATTACK && HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISARMED)) + if(!CanUseAttackType(attType)) { weapon_mindamage = 0; weapon_maxdamage = 0; |