Skip to content

fix: weapons only elemental damage #3341

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/items/weapons/weapons.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
// Players
int32_t Weapons::getMaxWeaponDamage(uint32_t level, int32_t attackSkill, int32_t attackValue, float attackFactor, bool isMelee) {
if (isMelee) {
return static_cast<int32_t>(std::round((0.085 * attackFactor * attackValue * attackSkill) + (level / 5)));
return attackValue > 0 ? static_cast<int32_t>(std::round((0.085 * attackFactor * attackValue * attackSkill) + (level / 5))) : 0;
} else {
return static_cast<int32_t>(std::round((0.09 * attackFactor * attackValue * attackSkill) + (level / 5)));
}
Expand Down Expand Up @@ -629,7 +629,7 @@

const auto maxValue = static_cast<int32_t>(Weapons::getMaxWeaponDamage(level, attackSkill, combinedAttack, attackFactor, true) * player->getVocation()->meleeDamageMultiplier);

const int32_t minValue = level / 5;
const int32_t minValue = attackValue > 0 ? level / 5 : 0;

Check failure on line 632 in src/items/weapons/weapons.cpp

View workflow job for this annotation

GitHub Actions / ubuntu-24.04-linux-release

‘attackValue’ was not declared in this scope

Check failure on line 632 in src/items/weapons/weapons.cpp

View workflow job for this annotation

GitHub Actions / ubuntu-22.04-linux-release

‘attackValue’ was not declared in this scope

Check failure on line 632 in src/items/weapons/weapons.cpp

View workflow job for this annotation

GitHub Actions / ubuntu-22.04-linux-debug

‘attackValue’ was not declared in this scope

Check failure on line 632 in src/items/weapons/weapons.cpp

View workflow job for this annotation

GitHub Actions / ubuntu-24.04-linux-debug

‘attackValue’ was not declared in this scope

Check failure on line 632 in src/items/weapons/weapons.cpp

View workflow job for this annotation

GitHub Actions / windows-2022-windows-release

'minValue': const object must be initialized

Check failure on line 632 in src/items/weapons/weapons.cpp

View workflow job for this annotation

GitHub Actions / windows-2022-windows-release

'attackValue': undeclared identifier

if (maxDamage) {
return -maxValue;
Expand Down
Loading