Skip to content

Commit

Permalink
Fix spectator mode
Browse files Browse the repository at this point in the history
Took 2 minutes
  • Loading branch information
TheNathanSpace committed Sep 9, 2021
1 parent 6d7f07e commit 4311350
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,11 @@ else if ((System.nanoTime() - gamePlayer.startTimeInAir) / 1000000000. > 5)
return;
}

if (PlayerMode.getPlayerMode(player) != null && PlayerMode.getPlayerMode(player).equals(PlayerMode.SPECTATOR))
{
return;
}

if (gameInstance.gameStage.equals(GameStage.BUILDING))
{
GamePlayer gamePlayer = gameInstance.getGamePlayer(player);
Expand All @@ -122,15 +127,15 @@ else if ((System.nanoTime() - gamePlayer.startTimeInAir) / 1000000000. > 5)
if (newLocation.getX() > gameInstance.gameMap.borderX && gamePlayer.gameTeam.mapBase.objective.x < gameInstance.gameMap.borderX)
{
cancelMovement(playerMoveEvent);

player.sendMessage(Assault.ASSAULT_PREFIX + "You can't go over here!");
return;
}

if (newLocation.getX() < gameInstance.gameMap.borderX && gamePlayer.gameTeam.mapBase.objective.x > gameInstance.gameMap.borderX)
{
cancelMovement(playerMoveEvent);

player.sendMessage(Assault.ASSAULT_PREFIX + "You can't go over here!");
return;
}
Expand Down

0 comments on commit 4311350

Please sign in to comment.