Skip to content

Commit

Permalink
fix: blessings calculations (#3126)
Browse files Browse the repository at this point in the history
Wrong blessing calculations
  • Loading branch information
murilo09 authored Nov 18, 2024
1 parent ba6ad33 commit 3bdad99
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/creatures/players/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3517,7 +3517,7 @@ void Player::death(const std::shared_ptr<Creature> &lastHitCreature) {
}

// Level loss
auto expLoss = static_cast<uint64_t>(std::ceil((experience * deathLossPercent) / 100.));
auto expLoss = static_cast<uint64_t>(std::ceil(experience * deathLossPercent));
g_logger().debug("[{}] - experience lost {}", __FUNCTION__, expLoss);

g_events().eventPlayerOnLoseExperience(static_self_cast<Player>(), expLoss);
Expand Down Expand Up @@ -6323,9 +6323,9 @@ double Player::getLostPercent() const {
g_logger().debug("[{}] - after promotion {}", __FUNCTION__, percentReduction);
}

g_logger().debug("[{}] - total lost percent {}", __FUNCTION__, lossPercent - (lossPercent * percentReduction));
g_logger().debug("[{}] - total lost percent {}", __FUNCTION__, (lossPercent * (1 - percentReduction)) / 100.);

return lossPercent - (lossPercent * percentReduction);
return (lossPercent * (1 - percentReduction)) / 100.;
}

[[nodiscard]] const std::string &Player::getGuildNick() const {
Expand Down

0 comments on commit 3bdad99

Please sign in to comment.