Opened 8 years ago

Closed 8 years ago

Last modified 8 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 8 years ago.
territoryBlinking.2.diff (5.3 KB ) - added by sanderd17 8 years ago.

Download all attachments as: .zip

Change History (6)

by sanderd17, 8 years ago

Attachment: territoryBlinking.diff added

comment:1 by sanderd17, 8 years ago

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 by sanderd17, 8 years ago

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

by sanderd17, 8 years ago

Attachment: territoryBlinking.2.diff added

comment:3 by sanderd17, 8 years ago

Owner: set to sanderd17
Resolution: fixed
Status: newclosed

In 18012:

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

comment:4 by sanderd17, 8 years ago

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