Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#3891 closed defect (fixed)

[PATCH] Territory isn't updated when diplomacy changes

Reported by: sanderd17 Owned by: sanderd17
Priority: Should Have Milestone: Alpha 21
Component: UI & Simulation Keywords: patch
Cc: Patch:

Description

Unconnected territory that's connected to allied territory shouldn't blink.

So when diplomacy changes, the territory has to be updated.

Currently, territory keeps blinking and decay keeps happening until some actual territory change happens (building constructed or demolished).

I see two possibilities to fix this, but I doubt which is the best:

  • The DiplomacyChanged message could be defined in C++, and then the TerritoryManager could listen for it. But that would be a bit awkward since the C++ side doesn't know anything about diplomacy so far.
  • The MakeDirty method of the TerritoryManager could be exposed to the JS side, and the player component could call it every time diplomacy changes.

Attachments (2)

territoryBlinking.diff (5.3 KB) - added by sanderd17 4 years ago.
territoryBlinking.2.diff (5.3 KB) - added by sanderd17 4 years ago.

Download all attachments as: .zip

Change History (6)

Changed 4 years ago by sanderd17

Attachment: territoryBlinking.diff added

comment:1 Changed 4 years ago by sanderd17

This patch is a bit different from the two described options: it lets the Decay component listen to DiplomacyChanged? message, and allows the decay component to disable the blinking of a certain territory again.

The advantage is that it costs a lot less calculations: calculating the blinkingness is only one FloodFill? (of that unconnected territory), while recalculating the entire territory will cause a lot more FloodFills?.

comment:2 Changed 4 years ago by sanderd17

Keywords: patch review added
Milestone: BacklogAlpha 21
Summary: Territory isn't updated when diplomacy changes[PATCH] Territory isn't updated when diplomacy changes

Changed 4 years ago by sanderd17

Attachment: territoryBlinking.2.diff added

comment:3 Changed 4 years ago by sanderd17

Owner: set to sanderd17
Resolution: fixed
Status: newclosed

In 18012:

Fix territory not being updated when diplomacy changes. Fixes #3891

comment:4 Changed 4 years ago by sanderd17

Keywords: review removed
Note: See TracTickets for help on using tickets.