Skip to content

Commit

Permalink
fix: apply global attack multiplier only for players
Browse files Browse the repository at this point in the history
  • Loading branch information
omarcopires committed Dec 5, 2024
1 parent d52ffa6 commit d7c7bac
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion config.lua.dist
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ rateSpellCooldown = 1.0
rateAttackSpeed = 1.0
rateOfflineTrainingSpeed = rateAttackSpeed
rateExerciseTrainingSpeed = rateAttackSpeed
ratePlayerAttack = 1
ratePlayerAttack = 1.0

-- Monster rates
rateMonsterHealth = 1.0
Expand Down
9 changes: 5 additions & 4 deletions src/creatures/combat/combat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2280,10 +2280,11 @@ void Combat::applyExtensions(const std::shared_ptr<Creature> &caster, const std:
damage.secondary.value *= monster->getAttackMultiplier();
}

const double globalMultiplier = g_configManager().getFloat(RATE_PLAYER_ATTACK);

damage.primary.value = static_cast<int32_t>(damage.primary.value * globalMultiplier);
damage.secondary.value = static_cast<int32_t>(damage.secondary.value * globalMultiplier);
if (player) {
const double globalMultiplier = g_configManager().getFloat(RATE_PLAYER_ATTACK);
damage.primary.value = static_cast<int32_t>(damage.primary.value * globalMultiplier);
damage.secondary.value = static_cast<int32_t>(damage.secondary.value * globalMultiplier);
}
}

MagicField::MagicField(uint16_t type) :
Expand Down

0 comments on commit d7c7bac

Please sign in to comment.