diff --git a/src/items/weapons/weapons.cpp b/src/items/weapons/weapons.cpp index 2ec09945f36..e7d49dc5a58 100644 --- a/src/items/weapons/weapons.cpp +++ b/src/items/weapons/weapons.cpp @@ -78,7 +78,7 @@ int32_t Weapons::getMaxMeleeDamage(int32_t attackSkill, int32_t attackValue) { // Players int32_t Weapons::getMaxWeaponDamage(uint32_t level, int32_t attackSkill, int32_t attackValue, float attackFactor, bool isMelee) { if (isMelee) { - return static_cast(std::round((0.085 * attackFactor * attackValue * attackSkill) + (level / 5))); + return attackValue > 0 ? static_cast(std::round((0.085 * attackFactor * attackValue * attackSkill) + (level / 5))) : 0; } else { return static_cast(std::round((0.09 * attackFactor * attackValue * attackSkill) + (level / 5))); } @@ -623,7 +623,7 @@ int32_t WeaponMelee::getWeaponDamage(const std::shared_ptr &player, cons const int32_t maxValue = static_cast(Weapons::getMaxWeaponDamage(level, attackSkill, attackValue, attackFactor, true) * player->getVocation()->meleeDamageMultiplier); - const int32_t minValue = level / 5; + const int32_t minValue = attackValue > 0 ? level / 5 : 0; if (maxDamage) { return -maxValue;