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>
This commit is contained in:
lyrjie
2020-01-19 19:40:44 +03:00
committed by Yair Morgenstern
parent 32ba55b2fe
commit 762af74b61

View File

@ -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()
}