public void endTurn() {
		panel.getMatchInfoPanel().setSurrenderPending(false);
		getCurrentPlayer().endTurn();
		cancelCurrentAction(); //Don't let the next player use the previous player's selections.
		panel.setTile(null, null, null, null, true);
		if (inProgress) {
			do {
				currentPlayerIndex++;
				if (currentPlayerIndex == players.length) {
					currentPlayerIndex = 0; //Change the current player index back to 0 before doing anything with it, for consistency.
				}
				if (currentPlayerIndex == firstPlayerIndex) {
					currentRound++; //Since the first player is playing again, this is a new round.
				}
				for (Player player : players) {
					player.tickDownUnitStatuses(currentPlayerIndex);
				} //Tick down statuses even for players who get their turns passed over.
				board.tickDownTileStatuses(currentPlayerIndex);
			} while (getCurrentPlayer().isDefeated()); //Skip turns for defeated players.
			
			beginTurn();
		}
	}