Changeset - r8855:a884f435767d
[Not reviewed]
master
0 9 0
rubidium - 16 years ago 2008-04-07 20:03:46
rubidium@openttd.org
(svn r12617) -Codechange: add type safety to the Order's load and unload types.
9 files changed with 56 insertions and 57 deletions:
0 comments (0 inline, 0 general)
src/ai/default/default.cpp
Show inline comments
 
@@ -2551,15 +2551,15 @@ handle_nocash:
 
			(_opt.landscape == LT_TEMPERATE && _players_ai[p->index].cargo_type == CT_VALUABLES)
 
		);
 
		Order order;
 

	
 
		order.MakeGoToStation(AiGetStationIdByDef(aib->use_tile, aib->cur_building_rule));
 

	
 
		if (!is_pass && i == 1) order.SetUnloadType(OFB_UNLOAD);
 
		if (!is_pass && i == 1) order.SetUnloadType(OUFB_UNLOAD);
 
		if (_players_ai[p->index].num_want_fullload != 0 && (is_pass || i == 0))
 
			order.SetLoadType(OFB_FULL_LOAD);
 
			order.SetLoadType(OLFB_FULL_LOAD);
 

	
 
		DoCommand(0, loco_id + (i << 16), order.Pack(), DC_EXEC, CMD_INSERT_ORDER);
 
	}
 

	
 
	DoCommand(0, loco_id, 0, DC_EXEC, CMD_START_STOP_TRAIN);
 

	
 
@@ -3286,15 +3286,15 @@ static void AiStateBuildRoadVehicles(Pla
 
			(_opt.landscape == LT_TEMPERATE && _players_ai[p->index].cargo_type == CT_VALUABLES)
 
		);
 
		Order order;
 

	
 
		order.MakeGoToStation(AiGetStationIdFromRoadBlock(aib->use_tile, aib->cur_building_rule));
 

	
 
		if (!is_pass && i == 1) order.SetUnloadType(OFB_UNLOAD);
 
		if (!is_pass && i == 1) order.SetUnloadType(OUFB_UNLOAD);
 
		if (_players_ai[p->index].num_want_fullload != 0 && (is_pass || i == 0))
 
			order.SetLoadType(OFB_FULL_LOAD);
 
			order.SetLoadType(OLFB_FULL_LOAD);
 

	
 
		DoCommand(0, loco_id + (i << 16), order.Pack(), DC_EXEC, CMD_INSERT_ORDER);
 
	}
 

	
 
	DoCommand(0, loco_id, 0, DC_EXEC, CMD_START_STOP_ROADVEH);
 
	DoCommand(0, loco_id, _ai_service_interval, DC_EXEC, CMD_CHANGE_SERVICE_INT);
 
@@ -3565,15 +3565,15 @@ static void AiStateBuildAircraftVehicles
 
		AiBuildRec *aib = (&_players_ai[p->index].src) + _players_ai[p->index].order_list_blocks[i];
 
		bool is_pass = (_players_ai[p->index].cargo_type == CT_PASSENGERS || _players_ai[p->index].cargo_type == CT_MAIL);
 
		Order order;
 

	
 
		order.MakeGoToStation(AiGetStationIdFromAircraftBlock(aib->use_tile, aib->cur_building_rule));
 

	
 
		if (!is_pass && i == 1) order.SetUnloadType(OFB_UNLOAD);
 
		if (!is_pass && i == 1) order.SetUnloadType(OUFB_UNLOAD);
 
		if (_players_ai[p->index].num_want_fullload != 0 && (is_pass || i == 0))
 
			order.SetLoadType(OFB_FULL_LOAD);
 
			order.SetLoadType(OLFB_FULL_LOAD);
 

	
 
		DoCommand(0, loco_id + (i << 16), order.Pack(), DC_EXEC, CMD_INSERT_ORDER);
 
	}
 

	
 
	DoCommand(0, loco_id, 0, DC_EXEC, CMD_START_STOP_AIRCRAFT);
 

	
src/ai/trolly/trolly.cpp
Show inline comments
 
@@ -1187,20 +1187,18 @@ static void AiNew_State_GiveOrders(Playe
 
		order.MakeGoToDepot(GetDepotByTile(_players_ainew[p->index].depot_tile)->index, ODTFB_PART_OF_ORDERS);
 
		AI_DoCommand(0, _players_ainew[p->index].veh_id + (idx << 16), order.Pack(), DC_EXEC, CMD_INSERT_ORDER);
 
	}
 

	
 
	idx = 0;
 
	order.MakeGoToStation(GetStationIndex(_players_ainew[p->index].to_tile));
 
	if (_players_ainew[p->index].tbt == AI_TRUCK && _players_ainew[p->index].to_deliver)
 
		order.SetLoadType(OFB_FULL_LOAD);
 
	if (_players_ainew[p->index].tbt == AI_TRUCK && _players_ainew[p->index].to_deliver) order.SetLoadType(OLFB_FULL_LOAD);
 
	AI_DoCommand(0, _players_ainew[p->index].veh_id + (idx << 16), order.Pack(), DC_EXEC, CMD_INSERT_ORDER);
 

	
 
	idx = 0;
 
	order.MakeGoToStation(GetStationIndex(_players_ainew[p->index].from_tile));
 
	if (_players_ainew[p->index].tbt == AI_TRUCK && _players_ainew[p->index].from_deliver)
 
		order.SetLoadType(OFB_FULL_LOAD);
 
	if (_players_ainew[p->index].tbt == AI_TRUCK && _players_ainew[p->index].from_deliver) order.SetLoadType(OLFB_FULL_LOAD);
 
	AI_DoCommand(0, _players_ainew[p->index].veh_id + (idx << 16), order.Pack(), DC_EXEC, CMD_INSERT_ORDER);
 

	
 
	// Start the engines!
 
	_players_ainew[p->index].state = AI_STATE_START_VEHICLE;
 
}
 

	
src/economy.cpp
Show inline comments
 
@@ -1486,27 +1486,27 @@ void VehiclePayment(Vehicle *front_v)
 

	
 
		for (CargoList::List::const_iterator it = cargos->begin(); it != cargos->end(); it++) {
 
			CargoPacket *cp = *it;
 
			if (!cp->paid_for &&
 
					cp->source != last_visited &&
 
					HasBit(ge->acceptance_pickup, GoodsEntry::ACCEPTANCE) &&
 
					(front_v->current_order.GetUnloadType() & OFB_TRANSFER) == 0) {
 
					(front_v->current_order.GetUnloadType() & OUFB_TRANSFER) == 0) {
 
				/* Deliver goods to the station */
 
				st->time_since_unload = 0;
 

	
 
				/* handle end of route payment */
 
				Money profit = DeliverGoods(cp->count, v->cargo_type, cp->source, last_visited, cp->source_xy, cp->days_in_transit);
 
				cp->paid_for = true;
 
				route_profit   += profit; // display amount paid for final route delivery, A-D of a chain A-B-C-D
 
				vehicle_profit += profit - cp->feeder_share;                    // whole vehicle is not payed for transfers picked up earlier
 

	
 
				result |= 1;
 

	
 
				SetBit(v->vehicle_flags, VF_CARGO_UNLOADING);
 
			} else if (front_v->current_order.GetUnloadType() & (OFB_UNLOAD | OFB_TRANSFER)) {
 
				if (!cp->paid_for && (front_v->current_order.GetUnloadType() & OFB_TRANSFER) != 0) {
 
			} else if (front_v->current_order.GetUnloadType() & (OUFB_UNLOAD | OUFB_TRANSFER)) {
 
				if (!cp->paid_for && (front_v->current_order.GetUnloadType() & OUFB_TRANSFER) != 0) {
 
					Money profit = GetTransportedGoodsIncome(
 
						cp->count,
 
						/* pay transfer vehicle for only the part of transfer it has done: ie. cargo_loaded_at_xy to here */
 
						DistanceManhattan(cp->loaded_at_xy, GetStation(last_visited)->xy),
 
						cp->days_in_transit,
 
						v->cargo_type);
 
@@ -1553,13 +1553,13 @@ void VehiclePayment(Vehicle *front_v)
 
static void LoadUnloadVehicle(Vehicle *v, int *cargo_left)
 
{
 
	assert(v->current_order.IsType(OT_LOADING));
 

	
 
	/* We have not waited enough time till the next round of loading/unloading */
 
	if (--v->load_unload_time_rem != 0) {
 
		if (_patches.improved_load && HasBit(v->current_order.GetLoadType(), OF_FULL_LOAD)) {
 
		if (_patches.improved_load && (v->current_order.GetLoadType() & OLFB_FULL_LOAD)) {
 
			/* 'Reserve' this cargo for this vehicle, because we were first. */
 
			for (; v != NULL; v = v->Next()) {
 
				if (v->cargo_cap != 0) cargo_left[v->cargo_type] -= v->cargo_cap - v->cargo.Count();
 
			}
 
		}
 
		return;
 
@@ -1601,18 +1601,18 @@ static void LoadUnloadVehicle(Vehicle *v
 

	
 
		if (HasBit(v->vehicle_flags, VF_CARGO_UNLOADING)) {
 
			uint cargo_count = v->cargo.Count();
 
			uint amount_unloaded = _patches.gradual_loading ? min(cargo_count, load_amount) : cargo_count;
 
			bool remaining; // Are there cargo entities in this vehicle that can still be unloaded here?
 

	
 
			if (HasBit(ge->acceptance_pickup, GoodsEntry::ACCEPTANCE) && !(u->current_order.GetUnloadType() & OFB_TRANSFER)) {
 
			if (HasBit(ge->acceptance_pickup, GoodsEntry::ACCEPTANCE) && !(u->current_order.GetUnloadType() & OUFB_TRANSFER)) {
 
				/* The cargo has reached it's final destination, the packets may now be destroyed */
 
				remaining = v->cargo.MoveTo(NULL, amount_unloaded, CargoList::MTA_FINAL_DELIVERY, last_visited);
 

	
 
				result |= 1;
 
			} else if (u->current_order.GetUnloadType() & (OFB_UNLOAD | OFB_TRANSFER)) {
 
			} else if (u->current_order.GetUnloadType() & (OUFB_UNLOAD | OUFB_TRANSFER)) {
 
				remaining = v->cargo.MoveTo(&ge->cargo, amount_unloaded);
 
				SetBit(ge->acceptance_pickup, GoodsEntry::PICKUP);
 

	
 
				result |= 2;
 
			} else {
 
				/* The order changed while unloading (unset unload/transfer) or the
 
@@ -1635,13 +1635,13 @@ static void LoadUnloadVehicle(Vehicle *v
 
			}
 

	
 
			continue;
 
		}
 

	
 
		/* Do not pick up goods that we unloaded */
 
		if (u->current_order.GetUnloadType() & OFB_UNLOAD) continue;
 
		if (u->current_order.GetUnloadType() & OUFB_UNLOAD) continue;
 

	
 
		/* update stats */
 
		int t;
 
		switch (u->type) {
 
			case VEH_TRAIN: t = u->u.rail.cached_max_speed; break;
 
			case VEH_ROAD:  t = u->max_speed / 2;           break;
 
@@ -1707,13 +1707,13 @@ static void LoadUnloadVehicle(Vehicle *v
 
	completely_emptied &= anything_unloaded;
 

	
 
	/* We update these variables here, so gradual loading still fills
 
	 * all wagons at the same time instead of using the same 'improved'
 
	 * loading algorithm for the wagons (only fill wagon when there is
 
	 * enough to fill the previous wagons) */
 
	if (_patches.improved_load && HasBit(u->current_order.GetLoadType(), OF_FULL_LOAD)) {
 
	if (_patches.improved_load && (u->current_order.GetLoadType() & OLFB_FULL_LOAD)) {
 
		/* Update left cargo */
 
		for (v = u; v != NULL; v = v->Next()) {
 
			if (v->cargo_cap != 0) cargo_left[v->cargo_type] -= v->cargo_cap - v->cargo.Count();
 
		}
 
	}
 

	
 
@@ -1726,13 +1726,13 @@ static void LoadUnloadVehicle(Vehicle *v
 
			const uint gradual_loading_wait_time[] = { 40, 20, 10, 20 };
 

	
 
			unloading_time = gradual_loading_wait_time[v->type];
 
		}
 
	} else {
 
		bool finished_loading = true;
 
		if (HasBit(v->current_order.GetLoadType(), OF_FULL_LOAD)) {
 
		if (v->current_order.GetLoadType() & OLFB_FULL_LOAD) {
 
			if (_patches.full_load_any) {
 
				/* if the aircraft carries passengers and is NOT full, then
 
				 * continue loading, no matter how much mail is in */
 
				if ((v->type == VEH_AIRCRAFT && IsCargoInClass(v->cargo_type, CC_PASSENGERS) && v->cargo_cap != v->cargo.Count()) ||
 
						(cargo_not_full && (cargo_full & ~cargo_not_full) == 0)) { // There are stull non-full cargos
 
					finished_loading = false;
src/industry_cmd.cpp
Show inline comments
 
@@ -1965,19 +1965,19 @@ int WhoCanServiceIndustry(Industry* ind)
 
		/* Check orders of the vehicle.
 
		 * We cannot check the first of shared orders only, since the first vehicle in such a chain
 
		 * may have a different cargo type.
 
		 */
 
		const Order *o;
 
		FOR_VEHICLE_ORDERS(v, o) {
 
			if (o->IsType(OT_GOTO_STATION) && !HasBit(o->GetUnloadType(), OF_TRANSFER)) {
 
			if (o->IsType(OT_GOTO_STATION) && !(o->GetUnloadType() & OUFB_TRANSFER)) {
 
				/* Vehicle visits a station to load or unload */
 
				Station *st = GetStation(o->GetDestination());
 
				if (!st->IsValid()) continue;
 

	
 
				/* Same cargo produced by industry is dropped here => not serviced by vehicle v */
 
				if (HasBit(o->GetUnloadType(), OF_UNLOAD) && !c_accepts) break;
 
				if ((o->GetUnloadType() & OUFB_UNLOAD) && !c_accepts) break;
 

	
 
				if (stations.find(st) != stations.end()) {
 
					if (v->owner == _local_player) return 2; // Player services industry
 
					result = 1; // Competitor services industry
 
				}
 
			}
src/openttd.cpp
Show inline comments
 
@@ -2303,14 +2303,14 @@ bool AfterLoadGame()
 

	
 
	if (CheckSavegameVersion(84)) {
 
		/* Update go to buoy orders because they are just waypoints */
 
		Order *order;
 
		FOR_ALL_ORDERS(order) {
 
			if (order->IsType(OT_GOTO_STATION) && GetStation(order->GetDestination())->IsBuoy()) {
 
				order->SetLoadType(0);
 
				order->SetUnloadType(0);
 
				order->SetLoadType(OLF_LOAD_IF_POSSIBLE);
 
				order->SetUnloadType(OUF_UNLOAD_IF_POSSIBLE);
 
			}
 
		}
 

	
 
		/* Set all share owners to PLAYER_SPECTATOR for
 
		 * 1) all inactive players
 
		 *     (when inactive players were stored in the savegame - TTD, TTDP and some
src/order_base.h
Show inline comments
 
@@ -158,26 +158,26 @@ public:
 
	 * @param subtype the subtype to change to.
 
	 * @pre IsType(OT_GOTO_DEPOT).
 
	 */
 
	void SetRefit(CargoID cargo, byte subtype = 0);
 

	
 
	/** How must the consist be loaded? */
 
	inline byte GetLoadType() const { return this->flags & OFB_FULL_LOAD; }
 
	inline OrderLoadFlags GetLoadType() const { return (OrderLoadFlags)(this->flags & OLFB_FULL_LOAD); }
 
	/** How must the consist be unloaded? */
 
	inline byte GetUnloadType() const { return GB(this->flags, 0, 2); }
 
	inline OrderUnloadFlags GetUnloadType() const { return (OrderUnloadFlags)GB(this->flags, 0, 2); }
 
	/** Where must we stop? */
 
	OrderNonStopFlags GetNonStopType() const;
 
	/** What caused us going to the depot? */
 
	inline OrderDepotTypeFlags GetDepotOrderType() const { return (OrderDepotTypeFlags)this->flags; }
 
	/** What are we going to do when in the depot. */
 
	inline OrderDepotActionFlags GetDepotActionType() const { return (OrderDepotActionFlags)this->flags; }
 

	
 
	/** Set how the consist must be loaded. */
 
	inline void SetLoadType(byte load_type) { SB(this->flags, 2, 1, !!load_type); }
 
	inline void SetLoadType(OrderLoadFlags load_type) { SB(this->flags, 2, 1, !!load_type); }
 
	/** Set how the consist must be unloaded. */
 
	inline void SetUnloadType(byte unload_type) { SB(this->flags, 0, 2, unload_type); }
 
	inline void SetUnloadType(OrderUnloadFlags unload_type) { SB(this->flags, 0, 2, unload_type); }
 
	/** Set whether we must stop at stations or not. */
 
	inline void SetNonStopType(OrderNonStopFlags non_stop_type) { SB(this->flags, 3, 1, !!non_stop_type); }
 
	/** Set the cause to go to the depot. */
 
	inline void SetDepotOrderType(OrderDepotTypeFlags depot_order_type) { this->flags = depot_order_type; }
 
	/** Set what we are going to do in the depot. */
 
	inline void SetDepotActionType(OrderDepotActionFlags depot_service_type) { this->flags = depot_service_type; }
src/order_cmd.cpp
Show inline comments
 
@@ -319,17 +319,17 @@ CommandCost CmdInsertOrder(TileIndex til
 

	
 
			/* Order flags can be any of the following for stations:
 
			 * [full-load | unload] [+ transfer] [+ non-stop]
 
			 * non-stop orders (if any) are only valid for trains */
 
			switch (new_order.GetLoadType() | new_order.GetUnloadType()) {
 
				case 0:
 
				case OFB_FULL_LOAD:
 
				case OFB_FULL_LOAD | OFB_TRANSFER:
 
				case OFB_UNLOAD:
 
				case OFB_UNLOAD | OFB_TRANSFER:
 
				case OFB_TRANSFER:
 
				case OLFB_FULL_LOAD:
 
				case OLFB_FULL_LOAD | OUFB_TRANSFER:
 
				case OUFB_UNLOAD:
 
				case OUFB_UNLOAD | OUFB_TRANSFER:
 
				case OUFB_TRANSFER:
 
					break;
 

	
 
				default: return CMD_ERROR;
 
			}
 
			break;
 
		}
 
@@ -763,25 +763,25 @@ CommandCost CmdModifyOrder(TileIndex til
 
	if (flags & DC_EXEC) {
 
		switch (p2) {
 
			case OF_FULL_LOAD:
 
				if (order->IsType(OT_GOTO_DEPOT)) {
 
					order->SetDepotOrderType((OrderDepotTypeFlags)(order->GetDepotOrderType() ^ ODTFB_SERVICE));
 
				} else {
 
					order->SetLoadType(order->GetLoadType() ^ OFB_FULL_LOAD);
 
					order->SetUnloadType(order->GetUnloadType() & ~OFB_UNLOAD);
 
					order->SetLoadType((OrderLoadFlags)(order->GetLoadType() ^ OLFB_FULL_LOAD));
 
					order->SetUnloadType((OrderUnloadFlags)(order->GetUnloadType() & ~OUFB_UNLOAD));
 
				}
 
				break;
 
			case OF_UNLOAD:
 
				order->SetUnloadType(order->GetUnloadType() ^ OFB_UNLOAD);
 
				order->SetLoadType(0);
 
				order->SetUnloadType((OrderUnloadFlags)(order->GetUnloadType() ^ OUFB_UNLOAD));
 
				order->SetLoadType(OLF_LOAD_IF_POSSIBLE);
 
				break;
 
			case OF_NON_STOP:
 
				order->SetNonStopType(order->GetNonStopType() == ONSF_STOP_EVERYWHERE ? ONSF_NO_STOP_AT_ANY_STATION : ONSF_STOP_EVERYWHERE);
 
				break;
 
			case OF_TRANSFER:
 
				order->SetUnloadType(order->GetUnloadType() ^ OFB_TRANSFER);
 
				order->SetUnloadType((OrderUnloadFlags)(order->GetUnloadType() ^ OUFB_TRANSFER));
 
				break;
 
			default: NOT_REACHED();
 
		}
 

	
 
		/* Update the windows and full load flags, also for vehicles that share the same order list */
 
		{
src/order_type.h
Show inline comments
 
@@ -33,35 +33,37 @@ enum OrderType {
 
/* It needs to be 8bits, because we save and load it as such */
 
/** Define basic enum properties */
 
template <> struct EnumPropsT<OrderType> : MakeEnumPropsT<OrderType, byte, OT_BEGIN, OT_END, OT_END> {};
 
typedef TinyEnumT<OrderType> OrderTypeByte;
 

	
 

	
 
/* Order flags -- please use OF instead OF and use HASBIT/SETBIT/CLEARBIT */
 
/**
 
 * Flags related to the unloading order.
 
 */
 
enum OrderUnloadFlags {
 
	OUF_UNLOAD_IF_POSSIBLE = 0,      ///< Unload all cargo that the station accepts.
 
	OUFB_TRANSFER          = 1 << 0, ///< Transfer all cargo onto the platform.
 
	OUFB_UNLOAD            = 1 << 1, ///< Force unloading all cargo onto the platform, possibly not getting paid.
 
};
 

	
 
/** Order flag masks - these are for direct bit operations */
 
enum OrderFlagMasks {
 
	//Flags for stations:
 
	/** vehicle will transfer cargo (i. e. not deliver to nearby industry/town even if accepted there) */
 
	OFB_TRANSFER           = 0x1,
 
	/** If OFB_TRANSFER is not set, drop any cargo loaded. If accepted, deliver, otherwise cargo remains at the station.
 
      * No new cargo is loaded onto the vehicle whatsoever */
 
	OFB_UNLOAD             = 0x2,
 
	/** Wait for full load of all vehicles, or of at least one cargo type, depending on patch setting
 
	  * @todo make this two different flags */
 
	OFB_FULL_LOAD          = 0x4,
 
/**
 
 * Flags related to the loading order.
 
 */
 
enum OrderLoadFlags {
 
	OLF_LOAD_IF_POSSIBLE = 0,      ///< Load as long as there is cargo that fits in the train.
 
	OLFB_FULL_LOAD       = 1 << 2, ///< Full load the complete (or a single cargo) of the consist.
 
};
 

	
 
/**
 
 * Non-stop order flags.
 
 */
 
enum OrderNonStopFlags {
 
	ONSF_STOP_EVERYWHERE                  = 0,
 
	ONSF_NO_STOP_AT_INTERMEDIATE_STATIONS = 1,
 
	ONSF_NO_STOP_AT_DESTINATION_STATION   = 2,
 
	ONSF_NO_STOP_AT_ANY_STATION           = 3
 
	ONSF_STOP_EVERYWHERE                  = 0, ///< The vehicle will stop at any station it passes and the destination.
 
	ONSF_NO_STOP_AT_INTERMEDIATE_STATIONS = 1, ///< The vehicle will not stop at any stations it passes except the destination.
 
	ONSF_NO_STOP_AT_DESTINATION_STATION   = 2, ///< The vehicle will stop at any station it passes except the destination.
 
	ONSF_NO_STOP_AT_ANY_STATION           = 3, ///< The vehicle will not stop at any stations it passes including the destination.
 
};
 

	
 
/**
 
 * Reasons that could cause us to go to the depot.
 
 */
 
enum OrderDepotTypeFlags {
 
@@ -75,15 +77,14 @@ enum OrderDepotTypeFlags {
 
 */
 
enum OrderDepotActionFlags {
 
	ODATF_SERVICE_ONLY   = 0,      ///< Only service the vehicle.
 
	ODATFB_HALT          = 1 << 2, ///< Service the vehicle and then halt it.
 
};
 

	
 
/** Order flags bits - these are for the *BIT macros
 
 * for descrption of flags, see OrderFlagMasks
 
 * @see OrderFlagMasks
 
/**
 
 * Enumeration for the 'flag' to toggle in CmdModifyOrder.
 
 */
 
enum {
 
	OF_TRANSFER          = 0,
 
	OF_UNLOAD            = 1,
 
	OF_FULL_LOAD         = 2,
 
	OF_NON_STOP          = 3
src/vehicle.cpp
Show inline comments
 
@@ -2172,13 +2172,13 @@ uint8 CalcPercentVehicleFilled(Vehicle *
 
	/* Count up max and used */
 
	for (; v != NULL; v = v->Next()) {
 
		count += v->cargo.Count();
 
		max += v->cargo_cap;
 
		if (v->cargo_cap != 0) {
 
			unloading += HasBit(v->vehicle_flags, VF_CARGO_UNLOADING) ? 1 : 0;
 
			loading |= !HasBit(u->current_order.GetUnloadType(), OF_UNLOAD) && st->goods[v->cargo_type].days_since_pickup != 255;
 
			loading |= !(u->current_order.GetUnloadType() & OUFB_UNLOAD) && st->goods[v->cargo_type].days_since_pickup != 255;
 
			cars++;
 
		}
 
	}
 

	
 
	if (unloading == 0 && loading)          *color = STR_PERCENT_UP;
 
	else if (cars == unloading || !loading) *color = STR_PERCENT_DOWN;
0 comments (0 inline, 0 general)