mirror of
https://github.com/yairm210/Unciv.git
synced 2025-02-11 11:28:03 +07: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 */
|
||||
private fun onWarDeclared() {
|
||||
diplomaticStatus = DiplomaticStatus.War
|
||||
|
||||
// Cancel all trades.
|
||||
for (trade in trades)
|
||||
for (offer in trade.theirOffers.filter { it.duration > 0 })
|
||||
@ -514,6 +512,8 @@ class DiplomacyManager() {
|
||||
trades.clear()
|
||||
updateHasOpenBorders()
|
||||
|
||||
diplomaticStatus = DiplomaticStatus.War
|
||||
|
||||
removeModifier(DiplomaticModifiers.YearsOfPeace)
|
||||
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
|
||||
@ -526,7 +526,7 @@ class DiplomacyManager() {
|
||||
|
||||
onWarDeclared()
|
||||
otherCivDiplomacy.onWarDeclared()
|
||||
|
||||
|
||||
otherCiv.addNotification("[${civInfo.civName}] has declared war on us!", NotificationIcon.War, 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()) {
|
||||
if (thirdCiv.knows(civInfo)
|
||||
&& thirdCiv.getDiplomacyManager(civInfo).canDeclareWar()) {
|
||||
|
Loading…
Reference in New Issue
Block a user