diff --git a/core/src/com/unciv/logic/GameInfo.kt b/core/src/com/unciv/logic/GameInfo.kt index 6aa69e4f84..e5492011bb 100644 --- a/core/src/com/unciv/logic/GameInfo.kt +++ b/core/src/com/unciv/logic/GameInfo.kt @@ -214,7 +214,7 @@ class GameInfo { //check is important or else switchTurn //would skip a turn if an AI civ calls nextTurn //this happens when resigning a multiplayer game - if (thisPlayer.isPlayerCivilization()){ + if (thisPlayer.isPlayerCivilization()) { switchTurn() } @@ -223,7 +223,7 @@ class GameInfo { || turns < simulateMaxTurns && simulateUntilWin // For multiplayer, if there are 3+ players and one is defeated or spectator, // we'll want to skip over their turn - || gameParameters.isOnlineMultiplayer && (thisPlayer.isDefeated() || thisPlayer.isSpectator()) + || gameParameters.isOnlineMultiplayer && (thisPlayer.isDefeated() || thisPlayer.isSpectator() && thisPlayer.playerId != UncivGame.Current.settings.userId) ) { if (!thisPlayer.isDefeated() || thisPlayer.isBarbarian()) { NextTurnAutomation.automateCivMoves(thisPlayer) diff --git a/core/src/com/unciv/logic/civilization/CivilizationInfo.kt b/core/src/com/unciv/logic/civilization/CivilizationInfo.kt index 1c51df99fe..35837cf20f 100644 --- a/core/src/com/unciv/logic/civilization/CivilizationInfo.kt +++ b/core/src/com/unciv/logic/civilization/CivilizationInfo.kt @@ -489,11 +489,12 @@ class CivilizationInfo { diplomacy[otherCiv.civName] = DiplomacyManager(this, otherCiv.civName) .apply { diplomaticStatus = DiplomaticStatus.Peace } - otherCiv.popupAlerts.add(PopupAlert(AlertType.FirstContact, civName)) + if (!otherCiv.isSpectator()) + otherCiv.popupAlerts.add(PopupAlert(AlertType.FirstContact, civName)) if (isCurrentPlayer()) UncivGame.Current.settings.addCompletedTutorialTask("Meet another civilization") - + if (!(isCityState() && otherCiv.isMajorCiv())) return if (warOnContact || otherCiv.isMinorCivAggressor()) return // No gift if they are bad people, or we are just about to be at war diff --git a/core/src/com/unciv/ui/newgamescreen/NewGameScreen.kt b/core/src/com/unciv/ui/newgamescreen/NewGameScreen.kt index fb098a9c1a..13826ac628 100644 --- a/core/src/com/unciv/ui/newgamescreen/NewGameScreen.kt +++ b/core/src/com/unciv/ui/newgamescreen/NewGameScreen.kt @@ -60,14 +60,6 @@ class NewGameScreen( rightSideButton.enable() rightSideButton.setText("Start game!".tr()) rightSideButton.onClick { - if (gameSetupInfo.gameParameters.players.none { it.playerType == PlayerType.Human }) { - val noHumanPlayersPopup = Popup(this) - noHumanPlayersPopup.addGoodSizedLabel("No human players selected!".tr()).row() - noHumanPlayersPopup.addCloseButton() - noHumanPlayersPopup.open() - return@onClick - } - if (gameSetupInfo.gameParameters.isOnlineMultiplayer) { for (player in gameSetupInfo.gameParameters.players.filter { it.playerType == PlayerType.Human }) { try { @@ -82,6 +74,19 @@ class NewGameScreen( } } + if (gameSetupInfo.gameParameters.players.none { + it.playerType == PlayerType.Human && + // do not allow multiplayer with only remote spectator(s) and AI(s) - non-MP that works + !(it.chosenCiv == Constants.spectator && gameSetupInfo.gameParameters.isOnlineMultiplayer && + it.playerId != UncivGame.Current.settings.userId) + }) { + val noHumanPlayersPopup = Popup(this) + noHumanPlayersPopup.addGoodSizedLabel("No human players selected!".tr()).row() + noHumanPlayersPopup.addCloseButton() + noHumanPlayersPopup.open() + return@onClick + } + Gdx.input.inputProcessor = null // remove input processing - nothing will be clicked! if (mapOptionsTable.mapTypeSelectBox.selected.value == MapType.custom) {