mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-20 09:17:47 +07:00
Resolved #3967 - City-states can no longer 'gift' you your unique units
This commit is contained in:
parent
98d551559b
commit
4b06a55bb5
@ -637,11 +637,11 @@ class CivilizationInfo {
|
||||
return (basicGoldCostOfSignResearchAgreement * gameInfo.gameParameters.gameSpeed.modifier).toInt()
|
||||
}
|
||||
|
||||
fun giftMilitaryUnitTo(otherCiv: CivilizationInfo) {
|
||||
fun gainMilitaryUnitFromCityState(otherCiv: CivilizationInfo) {
|
||||
val cities = NextTurnAutomation.getClosestCities(this, otherCiv)
|
||||
val city = cities.city1
|
||||
val militaryUnit = city.cityConstructions.getConstructableUnits()
|
||||
.filter { !it.unitType.isCivilian() && it.unitType.isLandUnit() }
|
||||
.filter { !it.unitType.isCivilian() && it.unitType.isLandUnit() && it.uniqueTo==null }
|
||||
.toList().random()
|
||||
// placing the unit may fail - in that case stay quiet
|
||||
val placedUnit = placeUnitNearTile(city.location, militaryUnit.name) ?: return
|
||||
|
@ -392,12 +392,13 @@ class DiplomacyManager() {
|
||||
if (!otherCivDiplomacy().hasFlag(DiplomacyFlags.ResearchAgreement))
|
||||
sciencefromResearchAgreement()
|
||||
}
|
||||
// This is confusingly named - in fact, the civ that has the flag set is the MAJOR civ
|
||||
DiplomacyFlags.ProvideMilitaryUnit.name -> {
|
||||
// Do not unset the flag
|
||||
// Do not unset the flag - they may return soon, and we'll continue from that point on
|
||||
if (civInfo.cities.isEmpty() || otherCiv().cities.isEmpty())
|
||||
continue@loop
|
||||
else
|
||||
civInfo.giftMilitaryUnitTo(otherCiv())
|
||||
civInfo.gainMilitaryUnitFromCityState(otherCiv())
|
||||
}
|
||||
DiplomacyFlags.AgreedToNotSettleNearUs.name -> {
|
||||
addModifier(DiplomaticModifiers.FulfilledPromiseToNotSettleCitiesNearUs, 10f)
|
||||
|
Loading…
Reference in New Issue
Block a user