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

burndelay and shockdelay 0 causes game to crash #177

Closed
MoonPadUSer opened this issue Jul 29, 2020 · 6 comments · Fixed by #179 · May be fixed by #182
Closed

burndelay and shockdelay 0 causes game to crash #177

MoonPadUSer opened this issue Jul 29, 2020 · 6 comments · Fixed by #179 · May be fixed by #182
Labels
bug Something isn't working

Comments

@MoonPadUSer
Copy link
Contributor

when turning burndelay to 0 the game will crash when you start burning.

@MoonPadUSer MoonPadUSer added the bug Something isn't working label Jul 29, 2020
@MoonPadUSer
Copy link
Contributor Author

The line that crashes the game seems to be
src/game/game.cpp:941
float fluc = float(millis%burndelay)*(0.25f+0.03f)/burndelay;

@MoonPadUSer
Copy link
Contributor Author

Just found another line that causes it too
src/game/game.cpp:3614
else pc *= 0.75f+(float(millis%burndelay)/float(burndelay*4));

@MoonPadUSer
Copy link
Contributor Author

another one:
src/game/hud.cpp:3289
float pc = interval >= burntime-500 ? 1.f+(interval-(burntime-500))/500.f : (interval%burndelay)/float(burndelay/2); if(pc > 1.f) pc = 2.f-pc;

@MoonPadUSer
Copy link
Contributor Author

I'll use std::max(burndelay, 1) instead of burndelay everywhere it's used to divide, then I'll add a comment When playing on servers with older version, this value can be overriden to be 0, thus add a check to prevent division by 0

@robalni
Copy link
Contributor

robalni commented Jul 29, 2020

It's the same with shockdelay.

@MoonPadUSer
Copy link
Contributor Author

I'll make a separate PR for fixing shockdelay

@MoonPadUSer MoonPadUSer changed the title burndelay 0 causes game to crash burndelay and shockdelay 0 causes game to crash Aug 2, 2020
@MoonPadUSer MoonPadUSer linked a pull request Aug 3, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants