mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-27 22:06:05 -04:00
Fixed units not being removed from open borders area after declaring war (#4584)
This commit is contained in:
parent
167d9705f7
commit
92c4e4e083
@ -505,8 +505,6 @@ class DiplomacyManager() {
|
|||||||
|
|
||||||
/** Everything that happens to both sides equally when war is delcared by one side on the other */
|
/** Everything that happens to both sides equally when war is delcared by one side on the other */
|
||||||
private fun onWarDeclared() {
|
private fun onWarDeclared() {
|
||||||
diplomaticStatus = DiplomaticStatus.War
|
|
||||||
|
|
||||||
// Cancel all trades.
|
// Cancel all trades.
|
||||||
for (trade in trades)
|
for (trade in trades)
|
||||||
for (offer in trade.theirOffers.filter { it.duration > 0 })
|
for (offer in trade.theirOffers.filter { it.duration > 0 })
|
||||||
@ -514,6 +512,8 @@ class DiplomacyManager() {
|
|||||||
trades.clear()
|
trades.clear()
|
||||||
updateHasOpenBorders()
|
updateHasOpenBorders()
|
||||||
|
|
||||||
|
diplomaticStatus = DiplomaticStatus.War
|
||||||
|
|
||||||
removeModifier(DiplomaticModifiers.YearsOfPeace)
|
removeModifier(DiplomaticModifiers.YearsOfPeace)
|
||||||
setFlag(DiplomacyFlags.DeclinedPeace, 10)/// AI won't propose peace for 10 turns
|
setFlag(DiplomacyFlags.DeclinedPeace, 10)/// AI won't propose peace for 10 turns
|
||||||
setFlag(DiplomacyFlags.DeclaredWar, 10) // AI won't agree to trade for 10 turns
|
setFlag(DiplomacyFlags.DeclaredWar, 10) // AI won't agree to trade for 10 turns
|
||||||
@ -526,7 +526,7 @@ class DiplomacyManager() {
|
|||||||
|
|
||||||
onWarDeclared()
|
onWarDeclared()
|
||||||
otherCivDiplomacy.onWarDeclared()
|
otherCivDiplomacy.onWarDeclared()
|
||||||
|
|
||||||
otherCiv.addNotification("[${civInfo.civName}] has declared war on us!", NotificationIcon.War, civInfo.civName)
|
otherCiv.addNotification("[${civInfo.civName}] has declared war on us!", NotificationIcon.War, civInfo.civName)
|
||||||
otherCiv.popupAlerts.add(PopupAlert(AlertType.WarDeclaration, civInfo.civName))
|
otherCiv.popupAlerts.add(PopupAlert(AlertType.WarDeclaration, civInfo.civName))
|
||||||
|
|
||||||
@ -582,8 +582,7 @@ class DiplomacyManager() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (otherCiv.isCityState())
|
if (otherCiv.isCityState()) {
|
||||||
{
|
|
||||||
for (thirdCiv in otherCiv.getProtectorCivs()) {
|
for (thirdCiv in otherCiv.getProtectorCivs()) {
|
||||||
if (thirdCiv.knows(civInfo)
|
if (thirdCiv.knows(civInfo)
|
||||||
&& thirdCiv.getDiplomacyManager(civInfo).canDeclareWar()) {
|
&& thirdCiv.getDiplomacyManager(civInfo).canDeclareWar()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user