Skip to content

Commit

Permalink
Fixed spam-spawn bug. The last commit is mine!
Browse files Browse the repository at this point in the history
  • Loading branch information
PWDrew committed May 6, 2014
1 parent 8853efe commit f109138
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/java/seprini/controllers/AircraftController.java
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,11 @@ public void update(float delta) throws InterruptedException {
Art.getSound("warning").play(1.0f);
}

// If the number of aircraft is below the maximum permitted, or the time
// elapsed since the last generation is less than
// If the number of aircraft is below the maximum permitted and the time
// elapsed since the last generation is greater than the preset
// time difference between aircraft generated, create a new aircraft
if (aircraftList.size() > difficulty.getMaxAircraft()
|| timer - lastGenerated > difficulty
if (aircraftList.size() < difficulty.getMaxAircraft()
&& timer - lastGenerated > difficulty
.getTimeBetweenGenerations() + rand.nextInt(100)) {
final Aircraft generatedAircraft = generateAircraft();

Expand Down

0 comments on commit f109138

Please sign in to comment.