Changeset - r12477:069be9651c2d
[Not reviewed]
master
0 1 0
rubidium - 15 years ago 2009-07-23 08:47:14
rubidium@openttd.org
(svn r16924) -Fix (r16922): selling or sending to depot, what's the difference? :)
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/vehicle_cmd.cpp
Show inline comments
 
@@ -163,25 +163,25 @@ CommandCost CmdMassStartStopVehicle(Tile
 
/** Sells all vehicles in a depot
 
 * @param tile Tile of the depot where the depot is
 
 * @param flags type of operation
 
 * @param p1 Vehicle type
 
 * @param p2 unused
 
 */
 
CommandCost CmdDepotSellAllVehicles(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
 
{
 
	VehicleList list;
 

	
 
	CommandCost cost(EXPENSES_NEW_VEHICLES);
 
	VehicleType vehicle_type = (VehicleType)GB(p1, 0, 8);
 
	uint sell_command = GetCmdSendToDepot(vehicle_type);;
 
	uint sell_command = GetCmdSellVeh(vehicle_type);;
 

	
 
	/* Get the list of vehicles in the depot */
 
	BuildDepotVehicleList(vehicle_type, tile, &list, &list);
 

	
 
	for (uint i = 0; i < list.Length(); i++) {
 
		CommandCost ret = DoCommand(tile, list[i]->index, 1, flags, sell_command);
 
		if (CmdSucceeded(ret)) cost.AddCost(ret);
 
	}
 

	
 
	if (cost.GetCost() == 0) return CMD_ERROR; // no vehicles to sell
 
	return cost;
 
}
0 comments (0 inline, 0 general)