Fix #5978: Ensure group GUI stats and lists are invalidated properly (3298, Juanjo) (#7046)

This commit is contained in:
Joan Josep
2019-01-13 23:29:17 +01:00
committed by Charles Pigott
parent ca7ee34502
commit 823c5bfa3b
2 changed files with 7 additions and 2 deletions

View File

@@ -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);