src/roadveh_cmd.cpp
changeset 8264 670152de17cb
parent 8191 3ffc17ef4ff5
child 8278 c10ecabf001d
equal deleted inserted replaced
8263:cf890c002a88 8264:670152de17cb
   365 
   365 
   366 	if (!CheckRoadVehInDepotStopped(v)) {
   366 	if (!CheckRoadVehInDepotStopped(v)) {
   367 		return_cmd_error(STR_9013_MUST_BE_STOPPED_INSIDE);
   367 		return_cmd_error(STR_9013_MUST_BE_STOPPED_INSIDE);
   368 	}
   368 	}
   369 
   369 
       
   370 	CommandCost ret(-v->value);
       
   371 
   370 	if (flags & DC_EXEC) {
   372 	if (flags & DC_EXEC) {
   371 		// Invalidate depot
   373 		// Invalidate depot
   372 		InvalidateWindow(WC_VEHICLE_DEPOT, v->tile);
   374 		InvalidateWindow(WC_VEHICLE_DEPOT, v->tile);
   373 		RebuildVehicleLists();
   375 		RebuildVehicleLists();
   374 		InvalidateWindow(WC_COMPANY, v->owner);
   376 		InvalidateWindow(WC_COMPANY, v->owner);
   375 		DeleteWindowById(WC_VEHICLE_VIEW, v->index);
   377 		DeleteWindowById(WC_VEHICLE_VIEW, v->index);
   376 		DeleteDepotHighlightOfVehicle(v);
   378 		DeleteDepotHighlightOfVehicle(v);
   377 		delete v;
   379 		delete v;
   378 	}
   380 	}
   379 
   381 
   380 	return CommandCost(-v->value);
   382 	return ret;
   381 }
   383 }
   382 
   384 
   383 struct RoadFindDepotData {
   385 struct RoadFindDepotData {
   384 	uint best_length;
   386 	uint best_length;
   385 	TileIndex tile;
   387 	TileIndex tile;