summaryrefslogtreecommitdiff
path: root/src/autoreplace_cmd.cpp
diff options
context:
space:
mode:
authorJoan Josep <juanjo.ng.83@gmail.com>2019-01-13 23:29:17 +0100
committerCharles Pigott <charlespigott@googlemail.com>2019-01-13 22:29:17 +0000
commit823c5bfa3bf403aeac55a44fadfba802dddb8e1e (patch)
treedec6972502e4614346dfe2c378026b9633700da7 /src/autoreplace_cmd.cpp
parentca7ee345024337d37932880ee9c1c3a9cb656697 (diff)
downloadopenttd-823c5bfa3bf403aeac55a44fadfba802dddb8e1e.tar.xz
Fix #5978: Ensure group GUI stats and lists are invalidated properly (3298, Juanjo) (#7046)
Diffstat (limited to 'src/autoreplace_cmd.cpp')
-rw-r--r--src/autoreplace_cmd.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/autoreplace_cmd.cpp b/src/autoreplace_cmd.cpp
index 48f818c94..95568e381 100644
--- a/src/autoreplace_cmd.cpp
+++ b/src/autoreplace_cmd.cpp
@@ -19,6 +19,7 @@
#include "autoreplace_gui.h"
#include "articulated_vehicles.h"
#include "core/random_func.hpp"
+#include "vehiclelist.h"
#include "table/strings.h"
@@ -777,6 +778,9 @@ CommandCost CmdSetAutoReplace(TileIndex tile, DoCommandFlag flags, uint32 p1, ui
if (flags & DC_EXEC) {
GroupStatistics::UpdateAutoreplace(_current_company);
if (IsLocalCompany()) SetWindowDirty(WC_REPLACE_VEHICLE, Engine::Get(old_engine_type)->type);
+
+ const VehicleType vt = Engine::Get(old_engine_type)->type;
+ SetWindowDirty(GetWindowClassForVehicleType(vt), VehicleListIdentifier(VL_GROUP_LIST, vt, _current_company).Pack());
}
if ((flags & DC_EXEC) && IsLocalCompany()) InvalidateAutoreplaceWindow(old_engine_type, id_g);