src/group_cmd.cpp
changeset 9043 eb4f06b99146
parent 9036 6368fe55fd6d
child 9070 dd0121143eba
--- a/src/group_cmd.cpp	Thu Apr 24 08:53:04 2008 +0000
+++ b/src/group_cmd.cpp	Thu Apr 24 09:55:20 2008 +0000
@@ -70,18 +70,6 @@
 }
 
 
-static WindowClass GetWCForVT(VehicleType vt)
-{
-	switch (vt) {
-		default:
-		case VEH_TRAIN:    return WC_TRAINS_LIST;
-		case VEH_ROAD:     return WC_ROADVEH_LIST;
-		case VEH_SHIP:     return WC_SHIPS_LIST;
-		case VEH_AIRCRAFT: return WC_AIRCRAFT_LIST;
-	}
-}
-
-
 /**
  * Create a new vehicle group.
  * @param tile unused
@@ -100,7 +88,7 @@
 		g->replace_protection = false;
 		g->vehicle_type = vt;
 
-		InvalidateWindowData(GetWCForVT(vt), (vt << 11) | VLW_GROUP_LIST | _current_player);
+		InvalidateWindowData(GetWindowClassForVehicleType(vt), (vt << 11) | VLW_GROUP_LIST | _current_player);
 	}
 
 	return CommandCost();
@@ -149,7 +137,7 @@
 		DeleteWindowById(WC_REPLACE_VEHICLE, g->vehicle_type);
 		delete g;
 
-		InvalidateWindowData(GetWCForVT(vt), (vt << 11) | VLW_GROUP_LIST | _current_player);
+		InvalidateWindowData(GetWindowClassForVehicleType(vt), (vt << 11) | VLW_GROUP_LIST | _current_player);
 	}
 
 	return CommandCost();
@@ -191,7 +179,7 @@
 		/* Assign the new one */
 		g->name = strdup(_cmd_text);
 
-		InvalidateWindowData(GetWCForVT(g->vehicle_type), (g->vehicle_type << 11) | VLW_GROUP_LIST | _current_player);
+		InvalidateWindowData(GetWindowClassForVehicleType(g->vehicle_type), (g->vehicle_type << 11) | VLW_GROUP_LIST | _current_player);
 	}
 
 	return CommandCost();
@@ -240,7 +228,7 @@
 
 		/* Update the Replace Vehicle Windows */
 		InvalidateWindow(WC_REPLACE_VEHICLE, v->type);
-		InvalidateWindowData(GetWCForVT(v->type), (v->type << 11) | VLW_GROUP_LIST | _current_player);
+		InvalidateWindowData(GetWindowClassForVehicleType(v->type), (v->type << 11) | VLW_GROUP_LIST | _current_player);
 	}
 
 	return CommandCost();
@@ -276,7 +264,7 @@
 			}
 		}
 
-		InvalidateWindowData(GetWCForVT(type), (type << 11) | VLW_GROUP_LIST | _current_player);
+		InvalidateWindowData(GetWindowClassForVehicleType(type), (type << 11) | VLW_GROUP_LIST | _current_player);
 	}
 
 	return CommandCost();
@@ -312,7 +300,7 @@
 			}
 		}
 
-		InvalidateWindowData(GetWCForVT(type), (type << 11) | VLW_GROUP_LIST | _current_player);
+		InvalidateWindowData(GetWindowClassForVehicleType(type), (type << 11) | VLW_GROUP_LIST | _current_player);
 	}
 
 	return CommandCost();
@@ -337,7 +325,7 @@
 	if (flags & DC_EXEC) {
 		g->replace_protection = HasBit(p2, 0);
 
-		InvalidateWindowData(GetWCForVT(g->vehicle_type), (g->vehicle_type << 11) | VLW_GROUP_LIST | _current_player);
+		InvalidateWindowData(GetWindowClassForVehicleType(g->vehicle_type), (g->vehicle_type << 11) | VLW_GROUP_LIST | _current_player);
 	}
 
 	return CommandCost();