mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-04 23:40:01 +07:00
When unable to support units, they disband one by one instead of all at the same time
This commit is contained in:
@ -21,8 +21,8 @@ android {
|
||||
applicationId "com.unciv.game"
|
||||
minSdkVersion 14
|
||||
targetSdkVersion 26
|
||||
versionCode 99
|
||||
versionName "2.6.2"
|
||||
versionCode 101
|
||||
versionName "2.6.3.1"
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
|
@ -190,11 +190,10 @@ class CivilizationInfo {
|
||||
|
||||
policies.endTurn(nextTurnStats.culture.toInt())
|
||||
|
||||
if(!isBarbarianCivilization() && gold < -100){
|
||||
// disband units until there are none left OR the gold values are normal
|
||||
val unitUpkeepBeforeDisbands = getUnitUpkeep()
|
||||
if(!isBarbarianCivilization() && gold < -100){
|
||||
var civMilitaryUnits = getCivUnits().filter { it.getBaseUnit().unitType!=UnitType.Civilian }
|
||||
while(nextTurnStats.gold.toInt() - unitUpkeepBeforeDisbands + getUnitUpkeep() < 0
|
||||
if(nextTurnStats.gold.toInt() < 0
|
||||
&& civMilitaryUnits.isNotEmpty()){
|
||||
val unitToDisband = civMilitaryUnits.first()
|
||||
unitToDisband.removeFromTile()
|
||||
|
Reference in New Issue
Block a user