Fix auto assign production not working after a building is built (#10299)

* Fix auto assign production not working after a building is built

* Fix issues in online multiplayer and remove validation in addbuiling
This commit is contained in:
SeventhM 2023-10-13 01:38:43 -07:00 committed by GitHub
parent 3eff519264
commit e587f28a88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 5 deletions

View File

@ -387,6 +387,7 @@ class CityConstructions : IsPartOfGameInfoSerialization {
if (construction.isBuildable(this))
constructionQueue.add(constructionName)
}
chooseNextConstruction()
}
private fun validateInProgressConstructions() {
@ -523,8 +524,6 @@ class CityConstructions : IsPartOfGameInfoSerialization {
updateUniques()
validateConstructionQueue()
/** Support for [UniqueType.CreatesOneImprovement] */
applyCreateOneImprovement(building)
@ -687,7 +686,6 @@ class CityConstructions : IsPartOfGameInfoSerialization {
private fun removeCurrentConstruction() = removeFromQueue(0, true)
fun chooseNextConstruction() {
validateConstructionQueue()
if (!isQueueEmptyOrIdle()) {
// If the USER set a perpetual construction, then keep it!
if (getConstruction(currentConstructionFromQueue) !is PerpetualConstruction || currentConstructionIsUserSet) return

View File

@ -115,7 +115,6 @@ class CivConstructions : IsPartOfGameInfoSerialization {
freeStatBuildingsProvided.addToMapOfSets(stat.name, city.id)
addFreeBuilding(city.id, building.name)
city.cityConstructions.constructionComplete(building)
building.postBuildEvent(city.cityConstructions)
}
}

View File

@ -401,4 +401,4 @@ suspend fun <T> attemptAction(
fun GameInfoPreview.isUsersTurn() = getCivilization(currentPlayer).playerId == UncivGame.Current.settings.multiplayer.userId
fun GameInfo.isUsersTurn() = getCivilization(currentPlayer).playerId == UncivGame.Current.settings.multiplayer.userId
fun GameInfo.isUsersTurn() = currentPlayer.isNotEmpty() && getCivilization(currentPlayer).playerId == UncivGame.Current.settings.multiplayer.userId