summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2011-11-20 14:39:12 +0000
committerfrosch <frosch@openttd.org>2011-11-20 14:39:12 +0000
commit107f67bfa46daf47916c761b755202ff1e578cba (patch)
tree68db25db0f9dfa217d4d2bee2898a2e9f0c22d3c
parent7f390964c3202212a696302d774256a950b621d9 (diff)
downloadopenttd-107f67bfa46daf47916c761b755202ff1e578cba.tar.xz
(svn r23282) -Fix [FS#4844] (r23212): CmdRemoveAllVehiclesGroup() was not passed the vehicle type in all cases, but the type is actually not needed.
-rw-r--r--src/group_cmd.cpp9
-rw-r--r--src/group_gui.cpp2
2 files changed, 5 insertions, 6 deletions
diff --git a/src/group_cmd.cpp b/src/group_cmd.cpp
index a636684e9..e4205be43 100644
--- a/src/group_cmd.cpp
+++ b/src/group_cmd.cpp
@@ -486,7 +486,7 @@ CommandCost CmdAddSharedVehicleGroup(TileIndex tile, DoCommandFlag flags, uint32
* @param flags type of operation
* @param p1 index of group array
* - p1 bit 0-15 : GroupID
- * @param p2 type of vehicles
+ * @param p2 unused
* @param text unused
* @return the cost of this operation or an error
*/
@@ -494,16 +494,15 @@ CommandCost CmdRemoveAllVehiclesGroup(TileIndex tile, DoCommandFlag flags, uint3
{
GroupID old_g = p1;
Group *g = Group::GetIfValid(old_g);
- VehicleType type = Extract<VehicleType, 0, 3>(p2);
- if (g == NULL || g->owner != _current_company || !IsCompanyBuildableVehicleType(type)) return CMD_ERROR;
+ if (g == NULL || g->owner != _current_company) return CMD_ERROR;
if (flags & DC_EXEC) {
Vehicle *v;
/* Find each Vehicle that belongs to the group old_g and add it to the default group */
FOR_ALL_VEHICLES(v) {
- if (v->type == type && v->IsPrimaryVehicle()) {
+ if (v->IsPrimaryVehicle()) {
if (v->group_id != old_g) continue;
/* Add The Vehicle to the default group */
@@ -511,7 +510,7 @@ CommandCost CmdRemoveAllVehiclesGroup(TileIndex tile, DoCommandFlag flags, uint3
}
}
- InvalidateWindowData(GetWindowClassForVehicleType(type), VehicleListIdentifier(VL_GROUP_LIST, type, _current_company).Pack());
+ InvalidateWindowData(GetWindowClassForVehicleType(g->vehicle_type), VehicleListIdentifier(VL_GROUP_LIST, g->vehicle_type, _current_company).Pack());
}
return CommandCost();
diff --git a/src/group_gui.cpp b/src/group_gui.cpp
index 3740bcb56..2070a0c2e 100644
--- a/src/group_gui.cpp
+++ b/src/group_gui.cpp
@@ -711,7 +711,7 @@ public:
case ADI_REMOVE_ALL: // Remove all Vehicles from the selected group
assert(Group::IsValidID(this->vli.index));
- DoCommandP(0, this->vli.index, this->vli.vtype, CMD_REMOVE_ALL_VEHICLES_GROUP | CMD_MSG(STR_ERROR_GROUP_CAN_T_REMOVE_ALL_VEHICLES));
+ DoCommandP(0, this->vli.index, 0, CMD_REMOVE_ALL_VEHICLES_GROUP | CMD_MSG(STR_ERROR_GROUP_CAN_T_REMOVE_ALL_VEHICLES));
break;
default: NOT_REACHED();
}