From a1f086e60c16a0f56b3fb7f909491016904b26a6 Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Sat, 26 Apr 2025 11:49:41 +0100 Subject: [PATCH] Fix #14107: Invalidate all shared vehicle windows when changing group. (#14110) Previously only windows of the first vehicle were invalidated. --- src/group_cmd.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/group_cmd.cpp b/src/group_cmd.cpp index 2ccbfe2420..3a0497f6bd 100644 --- a/src/group_cmd.cpp +++ b/src/group_cmd.cpp @@ -515,6 +515,9 @@ static void AddVehicleToGroup(Vehicle *v, GroupID new_g) break; } + InvalidateWindowData(WC_VEHICLE_VIEW, v->index); + InvalidateWindowData(WC_VEHICLE_DETAILS, v->index); + GroupStatistics::CountVehicle(v, 1); } @@ -572,10 +575,6 @@ std::tuple CmdAddVehicleGroup(DoCommandFlags flags, GroupI } SetWindowDirty(WC_VEHICLE_DEPOT, v->tile); - SetWindowDirty(WC_VEHICLE_VIEW, v->index); - SetWindowDirty(WC_VEHICLE_DETAILS, v->index); - InvalidateWindowData(WC_VEHICLE_VIEW, v->index); - InvalidateWindowData(WC_VEHICLE_DETAILS, v->index); } GroupStatistics::UpdateAutoreplace(_current_company);