Skip to content
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

fix: division by zero in spell cooldown calculation #1988

Merged
merged 6 commits into from
Dec 7, 2023

Conversation

dudantas
Copy link
Member

@dudantas dudantas commented Dec 7, 2023

Fixes potential division by zero error in the spell cooldown calculation. We have introduced a safety check to ensure rate_cooldown is not zero or extremely close to zero before performing the division. In cases where rate_cooldown is too small; it is reset to a minimal safe value to maintain functionality and avoid arithmetic exceptions. This change ensures stable and error-free operation even with small rate_cooldown values.

Resolves #1920
Resolves #1977

Copy link

sonarqubecloud bot commented Dec 7, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell D 7 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

@dudantas dudantas merged commit 3838427 into main Dec 7, 2023
36 checks passed
@dudantas dudantas deleted the dudantas/fix-division-by-zeo-exception branch December 7, 2023 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Server crashes on spell use Server crashes on spell use
2 participants