Bugfix: Level does not care after the last interval ended.

This commit is contained in:
Jan Philipp Timme 2014-12-09 11:15:48 +01:00
parent 5610ff7806
commit c810d9d966
1 changed files with 32 additions and 29 deletions

View File

@ -84,7 +84,9 @@ public final class Level {
public void handleUpdateTick() {
//Check whether the current interval is configured
int currentIntervalIndex = this.config.getIntervalIndexByCurrentTime(this.levelClock);
if(currentIntervalIndex == -1) return; //Nothing to do
//If there are still configured intervals, take care of the rules
if(currentIntervalIndex != -1) {
//Fetch the current interval
int[] currentInterval = this.config.intervalList.get(currentIntervalIndex);
int relativeTimeWithinCurrentInterval = this.levelClock - currentInterval[0];
@ -115,6 +117,7 @@ public final class Level {
}
}
}
} //end if still intervals configured
//Check for GameOver things.
this.checkGameOverCondition();