Closed fmatthew5876 closed 3 years ago
The crash is triggered here when fps-limit
is set to 0, the cause is indeed a division by 0. Does it make sense to add a check if fps
is 0 and if yes, then set ns
to a sufficiently low value to emulate (near) infinite FPS?
You mean set fps to a very high value? Like numeric_limit
Your suggestion sounds even better. Is better than setting ns
to a certain value if fps
is 0.
Using an arbitrarily high number could work.
Otherwise, I believe https://github.com/EasyRPG/Player/blob/master/src/baseui.cpp#L63 setting this frame_limit to 0 if the fps_limit is 0 would also work. Needs testing
@fmatthew5876 Your suggestion works for me. I have added a PR (#2684) to fix this issue.
Try
--fps-limit 0
to disable fps limit, you get an immediate crash. Probably a divide by 0 bug somewhere.