djyt / cannonball

Cannonball: An Enhanced OutRun Engine
http://reassembler.blogspot.com
649 stars 116 forks source link

Crash bug in time trial #15

Closed djcouchycouch closed 3 years ago

djcouchycouch commented 9 years ago

Hi,

After building on Win32 x86, if I run the game and go straight into time trial mode, it crashes.

The crash is located in outs.cpp, line 206.

converted[2] = ostats.lap_ms[ms_lookup];

It occurs because lap_ms hasn't been setup yet. It's null. OStats::clear_stage_times() hasn't been called yet. But if I go into the game first (which calls the function) and then go back to time trail, it works.

Thanks, djcc

djcouchycouch commented 9 years ago

Spent some more time on it. If I skip that line and keep going, it'll eventually call OInitEngine::setup_state1() which will properly set it up. A fix is just to give lap_ms a default value in OStats's constructor. I used LAP_MS_64 but I don't think it really make a difference because it gets set properly as soon as the engine gets initialized.

Thesch28 commented 6 years ago

Time Trial crashes on my 32 bits windows 7 pc too.

Thesch28 commented 6 years ago

I tried to play Time Trial in a 64 bits system and the game still crashes.

beh68030 commented 6 years ago

Will this ever get patched? I was able to fix it by following djcouchycouch's advice, but it's odd this issue was never resolved after almost 3 years

@Thesch28 Before you compile, open "ostats.cpp" in a text editor and make the following changes: OStats::OStats(void) { lap_ms = config.engine.fix_timer ? LAP_MS_60 : LAP_MS_64; }

djyt commented 3 years ago

Hello everyone. Yes, I haven't read any of these comments for years. Sorry about that. I am working on CannonBall again at the moment and have fixed this issue in the latest source. Thanks!

steviebferrari commented 3 years ago

If you switch to original mode then back to enhanced, time trial loads