Having 0 hp now removes the boat from being an active boat. #story[1292]

This commit is contained in:
zwu18
2017-09-26 18:20:11 +13:00
parent f4001e0ae3
commit 1b8fa59f0e
5 changed files with 15 additions and 9 deletions
@@ -640,7 +640,7 @@ public class MockRace extends RaceState {
for (MockBoat boat : this.boats) {
//If the boat is currently racing, count it.
if (boat.getStatus() == BoatStatusEnum.RACING) {
if (boat.getStatus() == BoatStatusEnum.RACING && boat.getHealth()>=1) {
numberOfActiveBoats++;
}
@@ -161,7 +161,7 @@ public class RaceLogic implements RunnableWithFramePeriod, Observer {
//As long as there is at least one boat racing, we still simulate the race.
if (race.getNumberOfActiveBoats() != 0) {
//System.out.println(race.getNumberOfActiveBoats());
//Get the time period of this frame.
long framePeriod = currentTime - previousFrameTime;