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