public void endTurn() {
        if (!requireOurTurn()) return;

        // Show the end turn dialog, or not.
        if (freeColClient.getClientOptions()
            .getBoolean(ClientOptions.SHOW_END_TURN_DIALOG)) {
            List<Unit> units = new ArrayList<Unit>();
            for (Unit unit : freeColClient.getMyPlayer().getUnits()) {
                if (unit.couldMove()) units.add(unit);
            }
            if (!units.isEmpty() && !gui.showEndTurnDialog(units)) return;
        }

        // Ensure end-turn mode sticks.
        if (moveMode < MODE_END_TURN) moveMode = MODE_END_TURN;

        // Make sure all goto orders are complete before ending turn.
        if (!doExecuteGotoOrders()) return;

        doEndTurn();
    }