File diff r12029:5b077ec055c0 → r12030:bf346482c342
src/roadveh_cmd.cpp
Show inline comments
 
@@ -312,8 +312,8 @@ bool RoadVehicle::IsStoppedInDepot() con
 
 */
 
CommandCost CmdSellRoadVeh(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
 
{
 
	Vehicle *v = Vehicle::GetIfValid(p1);
 
	if (v == NULL || v->type != VEH_ROAD || !CheckOwnership(v->owner)) return CMD_ERROR;
 
	RoadVehicle *v = RoadVehicle::GetIfValid(p1);
 
	if (v == NULL || !CheckOwnership(v->owner)) return CMD_ERROR;
 

	
 
	if (HASBITS(v->vehstatus, VS_CRASHED)) return_cmd_error(STR_CAN_T_SELL_DESTROYED_VEHICLE);
 

	
 
@@ -418,8 +418,8 @@ CommandCost CmdSendRoadVehToDepot(TileIn
 
		return SendAllVehiclesToDepot(VEH_ROAD, flags, p2 & DEPOT_SERVICE, _current_company, (p2 & VLW_MASK), p1);
 
	}
 

	
 
	Vehicle *v = Vehicle::GetIfValid(p1);
 
	if (v == NULL || v->type != VEH_ROAD) return CMD_ERROR;
 
	RoadVehicle *v = RoadVehicle::GetIfValid(p1);
 
	if (v == NULL) return CMD_ERROR;
 

	
 
	return v->SendToDepot(flags, (DepotCommand)(p2 & DEPOT_COMMAND_MASK));
 
}
 
@@ -1991,9 +1991,9 @@ CommandCost CmdRefitRoadVeh(TileIndex ti
 
	uint16 capacity = CALLBACK_FAILED;
 
	uint total_capacity = 0;
 

	
 
	Vehicle *v = Vehicle::GetIfValid(p1);
 
	RoadVehicle *v = RoadVehicle::GetIfValid(p1);
 

	
 
	if (v == NULL || v->type != VEH_ROAD || !CheckOwnership(v->owner)) return CMD_ERROR;
 
	if (v == NULL || !CheckOwnership(v->owner)) return CMD_ERROR;
 
	if (!v->IsStoppedInDepot()) return_cmd_error(STR_ERROR_ROAD_MUST_BE_STOPPED_INSIDE_DEPOT);
 
	if (v->vehstatus & VS_CRASHED) return_cmd_error(STR_CAN_T_REFIT_DESTROYED_VEHICLE);