From 762af74b61fcabcfbb1d8c07c7328e0563aca3ef Mon Sep 17 00:00:00 2001 From: lyrjie Date: Sun, 19 Jan 2020 19:40:44 +0300 Subject: [PATCH] Barbarians don't move/attack on the turn of their spawning (#1719) * Barbarians don't move/attack on the turn of their spawning * Revert "Barbarians don't move/attack on the turn of their spawning" This reverts commit b088fb8c * Better implementation Co-authored-by: dumichno <57294813+dumichno@users.noreply.github.com> --- core/src/com/unciv/logic/GameInfo.kt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/core/src/com/unciv/logic/GameInfo.kt b/core/src/com/unciv/logic/GameInfo.kt index 95762bdb8f..2b41926469 100644 --- a/core/src/com/unciv/logic/GameInfo.kt +++ b/core/src/com/unciv/logic/GameInfo.kt @@ -73,7 +73,6 @@ class GameInfo { currentPlayerIndex = (currentPlayerIndex+1) % civilizations.size if(currentPlayerIndex==0){ turns++ - if (turns % 10 == 0 && !gameParameters.noBarbarians) placeBarbarians() } thisPlayer = civilizations[currentPlayerIndex] thisPlayer.startTurn() @@ -82,8 +81,14 @@ class GameInfo { switchTurn() while(thisPlayer.playerType==PlayerType.AI){ - if(thisPlayer.isBarbarian() || !thisPlayer.isDefeated()) + if(thisPlayer.isBarbarian() || !thisPlayer.isDefeated()) { NextTurnAutomation().automateCivMoves(thisPlayer) + + // Placing barbarians after their turn + if (thisPlayer.isBarbarian() + && !gameParameters.noBarbarians + && turns % 10 == 0) placeBarbarians() + } switchTurn() }