Markroz / replicaisland

Automatically exported from code.google.com/p/replicaisland
Apache License 2.0
0 stars 0 forks source link

Game crashes suddenly during gameplay. #83

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Play game till Memory #025
2. Continue level till after getting the first red orb
3. Game will crash some time after this

What is the expected output? What do you see instead?
Game should continue playing. Instead it crashes completely, forcing a close.

What version of the product are you using? On what operating system?
Version as of 26th January 2014.
Running on Nexus 5 on Android 4.3.2

Please provide any additional information below.

Crash is caused by a division by 0 on line 88 in 
com.replica.replicaisland.GameThread.java.
The specific line is
    mGameRoot.sSystemRegistry.hudSystem.setFPS(1000 / (int)averageFrameTime);
If, for whatever reason, the averageFrameTime is 0, it will perform a division 
by 0.

A fix would be to do a check on averageFrameTime before attempting the division.

Original issue reported on code.google.com by troy...@gmail.com on 26 Jan 2014 at 6:37