Fix #14107: Invalidate all shared vehicle windows when changing group. (#14110)

Previously only windows of the first vehicle were invalidated.
This commit is contained in:
Peter Nelson
2025-04-26 11:49:41 +01:00
committed by GitHub
parent bb1d561369
commit a1f086e60c

View File

@@ -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<CommandCost, GroupID> 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);