Skip to content

Commit

Permalink
fix: division by zero exception
Browse files Browse the repository at this point in the history
  • Loading branch information
dudantas authored Dec 7, 2023
1 parent 0e1143f commit 03fda1b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/creatures/combat/spells.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,11 @@ void Spell::setWheelOfDestinyBoost(WheelSpellBoost_t boost, WheelSpellGrade_t gr
void Spell::applyCooldownConditions(std::shared_ptr<Player> player) const {
WheelSpellGrade_t spellGrade = player->wheel()->getSpellUpgrade(getName());
bool isUpgraded = getWheelOfDestinyUpgraded() && static_cast<uint8_t>(spellGrade) > 0;
auto rate_cooldown = (int32_t)g_configManager().getFloat(RATE_SPELL_COOLDOWN, __FUNCTION__);
auto rate_cooldown = g_configManager().getFloat(RATE_SPELL_COOLDOWN, __FUNCTION__);
if (std::abs(rate_cooldown) < std::numeric_limits<float>::epsilon()) {
rate_cooldown = 0.1;
}

if (cooldown > 0) {
int32_t spellCooldown = cooldown;
if (isUpgraded) {
Expand Down

0 comments on commit 03fda1b

Please sign in to comment.