Skip to content

Commit

Permalink
Add rule to prevent player from moving too far
Browse files Browse the repository at this point in the history
  • Loading branch information
klausdorer committed Jul 4, 2023
1 parent e18122b commit b51b326
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,11 @@ protected boolean onDuringBenchmark()
}
}

// stop if player is moving too much
if (posPlayer.getX() > playerInitial.getX() + 1.5) {
return true;
}

// stop if playmode changes (e.g. because someone scored an own goal)
if (worldModel.getPlayMode() != PlayMode.PLAY_ON) {
return true;
Expand Down

0 comments on commit b51b326

Please sign in to comment.