Fix map-mode viewports not updating when changing company and land colours

This commit is contained in:
Jonathan G Rennison
2020-11-20 17:47:12 +00:00
parent e6edcaf333
commit c4b09e4780
2 changed files with 6 additions and 0 deletions

View File

@@ -1052,6 +1052,9 @@ CommandCost CmdSetCompanyColour(TileIndex tile, DoCommandFlag flags, uint32 p1,
BuildOwnerLegend(); BuildOwnerLegend();
InvalidateWindowData(WC_SMALLMAP, 0, 1); InvalidateWindowData(WC_SMALLMAP, 0, 1);
extern void MarkAllViewportMapLandscapesDirty();
MarkAllViewportMapLandscapesDirty();
/* Company colour data is indirectly cached. */ /* Company colour data is indirectly cached. */
for (Vehicle *v : Vehicle::Iterate()) { for (Vehicle *v : Vehicle::Iterate()) {
if (v->owner == _current_company) { if (v->owner == _current_company) {

View File

@@ -909,6 +909,9 @@ static bool RedrawSmallmap(int32 p1)
BuildLandLegend(); BuildLandLegend();
BuildOwnerLegend(); BuildOwnerLegend();
SetWindowClassesDirty(WC_SMALLMAP); SetWindowClassesDirty(WC_SMALLMAP);
extern void MarkAllViewportMapLandscapesDirty();
MarkAllViewportMapLandscapesDirty();
return true; return true;
} }