Skip to content

Commit

Permalink
Fixed a bug, which prevented the game over sequence. Fixed a bug that…
Browse files Browse the repository at this point in the history
… caused Alite to crash if paused while an explosion was visible.
  • Loading branch information
CmdrStardust committed Feb 6, 2016
1 parent 4070bdc commit b93f6d5
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ final void engage() {
if (Settings.dockingComputerSpeed == 1) {
alite.setTimeFactor(PlayerCobra.SPEED_UP_FACTOR);
}
AliteLog.d("Time Warp", "Time Warp = " + alite.getTimeFactor());
if (Assets.danube == null) {
Assets.danube = alite.getAudio().newMusic("music/blue_danube.ogg", Sound.SoundType.MUSIC);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -476,8 +476,12 @@ public void performUpdate(float deltaTime) {
if (isDisposed || inGame == null) {
return;
}
int tf = ((Alite) game).getTimeFactor();
while((--tf >= 0) && inGame.isPlayerAlive()) {
if (inGame.isPlayerAlive()) {
int tf = ((Alite) game).getTimeFactor();
while (--tf >= 0 && inGame.isPlayerAlive()) {
inGame.performUpdate(deltaTime, allObjects);
}
} else {
inGame.performUpdate(deltaTime, allObjects);
}
if (informationScreen != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,13 @@ private void readObject(ObjectInputStream in) throws IOException {
}

protected void updateTextureCoordinates(SpriteData sprite) {
texCoordBuffer.clear();
if (sprite == null) {
// This can only happen if the player pauses the game when an
// explosion billboard is on the screen... We ignore it, it will
// be cleaned up in later frames anyway.
return;
}
texCoordBuffer.clear();
texCoordBuffer.put(sprite.x);
texCoordBuffer.put(sprite.y);
texCoordBuffer.put(sprite.x);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -783,32 +783,34 @@ final void update(float deltaTime) {
}
so.updateSpeed(deltaTime);
switch (currentState.peek()) {
case ATTACK:
attackObject(deltaTime);
break;
case BANK:
AliteLog.e("Updating bank state", "This should not happen...");
break;
case EVADE:
updateEvade(deltaTime);
break;
case FLEE:
fleeObject(deltaTime);
break;
case FLY_STRAIGHT:
flyStraight(deltaTime);
break;
case FLY_PATH:
flyPath(deltaTime);
break;
case IDLE:
break;
case TRACK:
updateTrack(deltaTime);
break;
case FOLLOW_CURVE:
followCurve(deltaTime);
break;
case ATTACK:
attackObject(deltaTime);
break;
case BANK:
AliteLog.e("Updating bank state", "This should not happen...");
break;
case EVADE:
updateEvade(deltaTime);
break;
case FLEE:
fleeObject(deltaTime);
break;
case FLY_STRAIGHT:
flyStraight(deltaTime);
break;
case FLY_PATH:
flyPath(deltaTime);
break;
case IDLE:
break;
case TRACK:
updateTrack(deltaTime);
break;
case FOLLOW_CURVE:
followCurve(deltaTime);
break;
default:
break;
}
if (Settings.VIS_DEBUG) {
if (so instanceof CobraMkIII && ((CobraMkIII) so).isPlayerCobra()) {
Expand Down

0 comments on commit b93f6d5

Please sign in to comment.