Spawn multiple great people if eligible (#10833)

* Spawn multiple great people if eligible

* Fix referrence to outdated dev environment
This commit is contained in:
SeventhM
2023-12-30 10:53:29 -08:00
committed by GitHub
parent 24c888ef19
commit cd4e0333f4

View File

@ -59,9 +59,12 @@ class TurnManager(val civInfo: Civilization) {
// Generate great people at the start of the turn, // Generate great people at the start of the turn,
// so they won't be generated out in the open and vulnerable to enemy attacks before you can control them // so they won't be generated out in the open and vulnerable to enemy attacks before you can control them
if (civInfo.cities.isNotEmpty()) { //if no city available, addGreatPerson will throw exception if (civInfo.cities.isNotEmpty()) { //if no city available, addGreatPerson will throw exception
val greatPerson = civInfo.greatPeople.getNewGreatPerson() var greatPerson = civInfo.greatPeople.getNewGreatPerson()
if (greatPerson != null && civInfo.gameInfo.ruleset.units.containsKey(greatPerson)) while (greatPerson != null) {
civInfo.units.addUnit(greatPerson) if (civInfo.gameInfo.ruleset.units.containsKey(greatPerson))
civInfo.units.addUnit(greatPerson)
greatPerson = civInfo.greatPeople.getNewGreatPerson()
}
civInfo.religionManager.startTurn() civInfo.religionManager.startTurn()
if (civInfo.isLongCountActive()) if (civInfo.isLongCountActive())
MayaCalendar.startTurnForMaya(civInfo) MayaCalendar.startTurnForMaya(civInfo)