Codechange: Use dynamic_cast instead of C-cast after FindWindowById. (#12448)

dynamic_cast was used in most places, but not all.
This commit is contained in:
Peter Nelson
2024-04-08 13:26:19 +01:00
committed by GitHub
parent 4e6d4fcf32
commit 74e09abf76
4 changed files with 6 additions and 6 deletions

View File

@@ -1169,7 +1169,7 @@ void ShowCompanyGroupForVehicle(const Vehicle *v)
*/
static inline VehicleGroupWindow *FindVehicleGroupWindow(VehicleType vt, Owner owner)
{
return (VehicleGroupWindow *)FindWindowById(GetWindowClassForVehicleType(vt), VehicleListIdentifier(VL_GROUP_LIST, vt, owner).Pack());
return dynamic_cast<VehicleGroupWindow *>(FindWindowById(GetWindowClassForVehicleType(vt), VehicleListIdentifier(VL_GROUP_LIST, vt, owner).Pack()));
}
/**