Changeset - r21471:ce169ca93e3c
[Not reviewed]
master
0 11 0
rubidium - 10 years ago 2014-05-11 18:02:11
rubidium@openttd.org
(svn r26580) -Codechange: s/GES_PICKUP/GES_RATING/ (it has nothing to do with actual pickup), s/acceptance_pickup/status/ (the enum isn't called GoodEntryStatus for a reason; it's not only acceptance and pickup anymore)
11 files changed with 36 insertions and 36 deletions:
0 comments (0 inline, 0 general)
src/economy.cpp
Show inline comments
 
@@ -1065,15 +1065,15 @@ static Money DeliverGoods(int num_pieces
 

	
 
	/* If this cargo type is always accepted, accept all */
 
	if (HasBit(st->always_accepted, cargo_type)) accepted = num_pieces;
 

	
 
	/* Update station statistics */
 
	if (accepted > 0) {
 
		SetBit(st->goods[cargo_type].acceptance_pickup, GoodsEntry::GES_EVER_ACCEPTED);
 
		SetBit(st->goods[cargo_type].acceptance_pickup, GoodsEntry::GES_CURRENT_MONTH);
 
		SetBit(st->goods[cargo_type].acceptance_pickup, GoodsEntry::GES_ACCEPTED_BIGTICK);
 
		SetBit(st->goods[cargo_type].status, GoodsEntry::GES_EVER_ACCEPTED);
 
		SetBit(st->goods[cargo_type].status, GoodsEntry::GES_CURRENT_MONTH);
 
		SetBit(st->goods[cargo_type].status, GoodsEntry::GES_ACCEPTED_BIGTICK);
 
	}
 

	
 
	/* Update company statistics */
 
	company->cur_economy.delivered_cargo[cargo_type] += accepted;
 

	
 
	/* Increase town's counter for town effects */
 
@@ -1239,13 +1239,13 @@ void PrepareUnload(Vehicle *front_v)
 
	if (front_v->orders.list == NULL || (front_v->current_order.GetUnloadType() & OUFB_NO_UNLOAD) == 0) {
 
		Station *st = Station::Get(front_v->last_station_visited);
 
		for (Vehicle *v = front_v; v != NULL; v = v->Next()) {
 
			const GoodsEntry *ge = &st->goods[v->cargo_type];
 
			if (v->cargo_cap > 0 && v->cargo.TotalCount() > 0) {
 
				v->cargo.Stage(
 
						HasBit(ge->acceptance_pickup, GoodsEntry::GES_ACCEPTANCE),
 
						HasBit(ge->status, GoodsEntry::GES_ACCEPTANCE),
 
						front_v->last_station_visited, next_station,
 
						front_v->current_order.GetUnloadType(), ge,
 
						front_v->cargo_payment);
 
				if (v->cargo.UnloadCount() > 0) SetBit(v->vehicle_flags, VF_CARGO_UNLOADING);
 
			}
 
		}
 
@@ -1530,13 +1530,13 @@ static void LoadUnloadVehicle(Vehicle *f
 
			uint cargo_count = v->cargo.UnloadCount();
 
			uint amount_unloaded = _settings_game.order.gradual_loading ? min(cargo_count, load_amount) : cargo_count;
 
			bool remaining = false; // Are there cargo entities in this vehicle that can still be unloaded here?
 

	
 
			payment->SetCargo(v->cargo_type);
 

	
 
			if (!HasBit(ge->acceptance_pickup, GoodsEntry::GES_ACCEPTANCE) && v->cargo.ActionCount(VehicleCargoList::MTA_DELIVER) > 0) {
 
			if (!HasBit(ge->status, GoodsEntry::GES_ACCEPTANCE) && v->cargo.ActionCount(VehicleCargoList::MTA_DELIVER) > 0) {
 
				/* The station does not accept our goods anymore. */
 
				if (front->current_order.GetUnloadType() & (OUFB_TRANSFER | OUFB_UNLOAD)) {
 
					/* Transfer instead of delivering. */
 
					v->cargo.Reassign<VehicleCargoList::MTA_DELIVER, VehicleCargoList::MTA_TRANSFER>(
 
							v->cargo.ActionCount(VehicleCargoList::MTA_DELIVER), INVALID_STATION);
 
				} else {
src/linkgraph/linkgraph.cpp
Show inline comments
 
@@ -178,13 +178,13 @@ NodeID LinkGraph::AddNode(const Station 
 
	/* Avoid reducing the height of the matrix as that is expensive and we
 
	 * most likely will increase it again later which is again expensive. */
 
	this->edges.Resize(new_node + 1U,
 
			max(new_node + 1U, this->edges.Height()));
 

	
 
	this->nodes[new_node].Init(st->index,
 
			HasBit(good.acceptance_pickup, GoodsEntry::GES_ACCEPTANCE));
 
			HasBit(good.status, GoodsEntry::GES_ACCEPTANCE));
 

	
 
	BaseEdge *new_edges = this->edges[new_node];
 

	
 
	/* Reset the first edge starting at the new node */
 
	new_edges[new_node].next_edge = INVALID_NODE;
 

	
src/newgrf_house.cpp
Show inline comments
 
@@ -377,16 +377,16 @@ static uint32 GetDistanceFromNearbyHouse
 
			const StationList *sl = stations.GetStations();
 

	
 
			/* Collect acceptance stats. */
 
			uint32 res = 0;
 
			for (Station * const * st_iter = sl->Begin(); st_iter != sl->End(); st_iter++) {
 
				const Station *st = *st_iter;
 
				if (HasBit(st->goods[cid].acceptance_pickup, GoodsEntry::GES_EVER_ACCEPTED))    SetBit(res, 0);
 
				if (HasBit(st->goods[cid].acceptance_pickup, GoodsEntry::GES_LAST_MONTH))       SetBit(res, 1);
 
				if (HasBit(st->goods[cid].acceptance_pickup, GoodsEntry::GES_CURRENT_MONTH))    SetBit(res, 2);
 
				if (HasBit(st->goods[cid].acceptance_pickup, GoodsEntry::GES_ACCEPTED_BIGTICK)) SetBit(res, 3);
 
				if (HasBit(st->goods[cid].status, GoodsEntry::GES_EVER_ACCEPTED))    SetBit(res, 0);
 
				if (HasBit(st->goods[cid].status, GoodsEntry::GES_LAST_MONTH))       SetBit(res, 1);
 
				if (HasBit(st->goods[cid].status, GoodsEntry::GES_CURRENT_MONTH))    SetBit(res, 2);
 
				if (HasBit(st->goods[cid].status, GoodsEntry::GES_ACCEPTED_BIGTICK)) SetBit(res, 3);
 
			}
 

	
 
			/* Cargo triggered CB 148? */
 
			if (HasBit(this->watched_cargo_triggers, cid)) SetBit(res, 4);
 

	
 
			return res;
src/newgrf_station.cpp
Show inline comments
 
@@ -393,13 +393,13 @@ uint32 Station::GetNewGRFVariable(const 
 
	switch (variable) {
 
		case 0x48: { // Accepted cargo types
 
			CargoID cargo_type;
 
			uint32 value = 0;
 

	
 
			for (cargo_type = 0; cargo_type < NUM_CARGO; cargo_type++) {
 
				if (HasBit(this->goods[cargo_type].acceptance_pickup, GoodsEntry::GES_ACCEPTANCE)) SetBit(value, cargo_type);
 
				if (HasBit(this->goods[cargo_type].status, GoodsEntry::GES_ACCEPTANCE)) SetBit(value, cargo_type);
 
			}
 
			return value;
 
		}
 

	
 
		case 0x8A: return this->had_vehicle_of_type;
 
		case 0xF1: return (this->airport.tile != INVALID_TILE) ? this->airport.GetSpec()->ttd_airport_type : ATP_TTDP_LARGE;
 
@@ -425,28 +425,28 @@ uint32 Station::GetNewGRFVariable(const 
 
		switch (variable) {
 
			case 0x60: return min(ge->cargo.TotalCount(), 4095);
 
			case 0x61: return ge->HasVehicleEverTriedLoading() ? ge->time_since_pickup : 0;
 
			case 0x62: return ge->HasRating() ? ge->rating : 0xFFFFFFFF;
 
			case 0x63: return ge->cargo.DaysInTransit();
 
			case 0x64: return ge->HasVehicleEverTriedLoading() ? ge->last_speed | (ge->last_age << 8) : 0xFF00;
 
			case 0x65: return GB(ge->acceptance_pickup, GoodsEntry::GES_ACCEPTANCE, 1) << 3;
 
			case 0x65: return GB(ge->status, GoodsEntry::GES_ACCEPTANCE, 1) << 3;
 
			case 0x69: {
 
				assert_compile((int)GoodsEntry::GES_EVER_ACCEPTED + 1 == (int)GoodsEntry::GES_LAST_MONTH);
 
				assert_compile((int)GoodsEntry::GES_EVER_ACCEPTED + 2 == (int)GoodsEntry::GES_CURRENT_MONTH);
 
				assert_compile((int)GoodsEntry::GES_EVER_ACCEPTED + 3 == (int)GoodsEntry::GES_ACCEPTED_BIGTICK);
 
				return GB(ge->acceptance_pickup, GoodsEntry::GES_EVER_ACCEPTED, 4);
 
				return GB(ge->status, GoodsEntry::GES_EVER_ACCEPTED, 4);
 
			}
 
		}
 
	}
 

	
 
	/* Handle cargo variables (deprecated) */
 
	if (variable >= 0x8C && variable <= 0xEC) {
 
		const GoodsEntry *g = &this->goods[GB(variable - 0x8C, 3, 4)];
 
		switch (GB(variable - 0x8C, 0, 3)) {
 
			case 0: return g->cargo.TotalCount();
 
			case 1: return GB(min(g->cargo.TotalCount(), 4095), 0, 4) | (GB(g->acceptance_pickup, GoodsEntry::GES_ACCEPTANCE, 1) << 7);
 
			case 1: return GB(min(g->cargo.TotalCount(), 4095), 0, 4) | (GB(g->status, GoodsEntry::GES_ACCEPTANCE, 1) << 7);
 
			case 2: return g->time_since_pickup;
 
			case 3: return g->rating;
 
			case 4: return g->cargo.Source();
 
			case 5: return g->cargo.DaysInTransit();
 
			case 6: return g->last_speed;
 
			case 7: return g->last_age;
src/saveload/afterload.cpp
Show inline comments
 
@@ -1596,13 +1596,13 @@ bool AfterLoadGame()
 

	
 
	if (IsSavegameVersionBefore(74)) {
 
		Station *st;
 
		FOR_ALL_STATIONS(st) {
 
			for (CargoID c = 0; c < NUM_CARGO; c++) {
 
				st->goods[c].last_speed = 0;
 
				if (st->goods[c].cargo.AvailableCount() != 0) SetBit(st->goods[c].acceptance_pickup, GoodsEntry::GES_PICKUP);
 
				if (st->goods[c].cargo.AvailableCount() != 0) SetBit(st->goods[c].status, GoodsEntry::GES_RATING);
 
			}
 
		}
 
	}
 

	
 
	if (IsSavegameVersionBefore(78)) {
 
		Industry *i;
src/saveload/oldloader_sl.cpp
Show inline comments
 
@@ -707,14 +707,14 @@ static bool LoadOldGood(LoadgameState *l
 

	
 
	Station *st = Station::Get(_current_station_id);
 
	GoodsEntry *ge = &st->goods[num];
 

	
 
	if (!LoadChunk(ls, ge, goods_chunk)) return false;
 

	
 
	SB(ge->acceptance_pickup, GoodsEntry::GES_ACCEPTANCE, 1, HasBit(_waiting_acceptance, 15));
 
	SB(ge->acceptance_pickup, GoodsEntry::GES_PICKUP, 1, _cargo_source != 0xFF);
 
	SB(ge->status, GoodsEntry::GES_ACCEPTANCE, 1, HasBit(_waiting_acceptance, 15));
 
	SB(ge->status, GoodsEntry::GES_RATING, 1, _cargo_source != 0xFF);
 
	if (GB(_waiting_acceptance, 0, 12) != 0 && CargoPacket::CanAllocateItem()) {
 
		ge->cargo.Append(new CargoPacket(GB(_waiting_acceptance, 0, 12), _cargo_days, (_cargo_source == 0xFF) ? INVALID_STATION : _cargo_source, 0, 0),
 
				INVALID_STATION);
 
	}
 

	
 
	return true;
src/saveload/station_sl.cpp
Show inline comments
 
@@ -264,13 +264,13 @@ static const SaveLoad _flow_desc[] = {
 
 * @return the saveload description for GoodsEntry.
 
 */
 
const SaveLoad *GetGoodsDesc()
 
{
 
	static const SaveLoad goods_desc[] = {
 
		SLEG_CONDVAR(            _waiting_acceptance,  SLE_UINT16,                  0, 67),
 
		 SLE_CONDVAR(GoodsEntry, acceptance_pickup,    SLE_UINT8,                  68, SL_MAX_VERSION),
 
		 SLE_CONDVAR(GoodsEntry, status,               SLE_UINT8,                  68, SL_MAX_VERSION),
 
		SLE_CONDNULL(2,                                                            51, 67),
 
		     SLE_VAR(GoodsEntry, time_since_pickup,    SLE_UINT8),
 
		     SLE_VAR(GoodsEntry, rating,               SLE_UINT8),
 
		SLEG_CONDVAR(            _cargo_source,        SLE_FILE_U8 | SLE_VAR_U16,   0, 6),
 
		SLEG_CONDVAR(            _cargo_source,        SLE_UINT16,                  7, 67),
 
		SLEG_CONDVAR(            _cargo_source_xy,     SLE_UINT32,                 44, 67),
 
@@ -336,13 +336,13 @@ static void Load_STNS()
 
		uint num_cargo = IsSavegameVersionBefore(55) ? 12 : NUM_CARGO;
 
		for (CargoID i = 0; i < num_cargo; i++) {
 
			GoodsEntry *ge = &st->goods[i];
 
			SlObject(ge, GetGoodsDesc());
 
			SwapPackets(ge);
 
			if (IsSavegameVersionBefore(68)) {
 
				SB(ge->acceptance_pickup, GoodsEntry::GES_ACCEPTANCE, 1, HasBit(_waiting_acceptance, 15));
 
				SB(ge->status, GoodsEntry::GES_ACCEPTANCE, 1, HasBit(_waiting_acceptance, 15));
 
				if (GB(_waiting_acceptance, 0, 12) != 0) {
 
					/* In old versions, enroute_from used 0xFF as INVALID_STATION */
 
					StationID source = (IsSavegameVersionBefore(7) && _cargo_source == 0xFF) ? INVALID_STATION : _cargo_source;
 

	
 
					/* Make sure we can allocate the CargoPacket. This is safe
 
					 * as there can only be ~64k stations and 32 cargoes in these
 
@@ -350,13 +350,13 @@ static void Load_STNS()
 
					 * 16 million entries; it fits by an order of magnitude. */
 
					assert(CargoPacket::CanAllocateItem());
 

	
 
					/* Don't construct the packet with station here, because that'll fail with old savegames */
 
					CargoPacket *cp = new CargoPacket(GB(_waiting_acceptance, 0, 12), _cargo_days, source, _cargo_source_xy, _cargo_source_xy, _cargo_feeder_share);
 
					ge->cargo.Append(cp, INVALID_STATION);
 
					SB(ge->acceptance_pickup, GoodsEntry::GES_PICKUP, 1, 1);
 
					SB(ge->status, GoodsEntry::GES_RATING, 1, 1);
 
				}
 
			}
 
		}
 

	
 
		if (st->num_specs != 0) {
 
			/* Allocate speclist memory when loading a game */
src/script/api/script_cargolist.cpp
Show inline comments
 
@@ -56,9 +56,9 @@ ScriptCargoList_IndustryProducing::Scrip
 
ScriptCargoList_StationAccepting::ScriptCargoList_StationAccepting(StationID station_id)
 
{
 
	if (!ScriptStation::IsValidStation(station_id)) return;
 

	
 
	Station *st = ::Station::Get(station_id);
 
	for (CargoID i = 0; i < NUM_CARGO; i++) {
 
		if (HasBit(st->goods[i].acceptance_pickup, GoodsEntry::GES_ACCEPTANCE)) this->AddItem(i);
 
		if (HasBit(st->goods[i].status, GoodsEntry::GES_ACCEPTANCE)) this->AddItem(i);
 
	}
 
}
src/station_base.h
Show inline comments
 
@@ -172,13 +172,13 @@ struct GoodsEntry {
 
		 * Set when the cargo was ever waiting at the station.
 
		 * It is set when cargo supplied by surrounding tiles is moved to the station, or when
 
		 * arriving vehicles unload/transfer cargo without it being a final delivery.
 
		 * This also indicates, whether a cargo has a rating at the station.
 
		 * This flag is never cleared.
 
		 */
 
		GES_PICKUP,
 
		GES_RATING,
 

	
 
		/**
 
		 * Set when a vehicle ever delivered cargo to the station for final delivery.
 
		 * This flag is never cleared.
 
		 */
 
		GES_EVER_ACCEPTED,
 
@@ -200,24 +200,24 @@ struct GoodsEntry {
 
		 * This flag is reset every STATION_ACCEPTANCE_TICKS ticks.
 
		 */
 
		GES_ACCEPTED_BIGTICK,
 
	};
 

	
 
	GoodsEntry() :
 
		acceptance_pickup(0),
 
		status(0),
 
		time_since_pickup(255),
 
		rating(INITIAL_STATION_RATING),
 
		last_speed(0),
 
		last_age(255),
 
		amount_fract(0),
 
		link_graph(INVALID_LINK_GRAPH),
 
		node(INVALID_NODE),
 
		max_waiting_cargo(0)
 
	{}
 

	
 
	byte acceptance_pickup; ///< Status of this cargo, see #GoodsEntryStatus.
 
	byte status; ///< Status of this cargo, see #GoodsEntryStatus.
 

	
 
	/**
 
	 * Number of rating-intervals (up to 255) since the last vehicle tried to load this cargo.
 
	 * The unit used is STATION_RATING_TICKS.
 
	 * This does not imply there was any cargo to load.
 
	 */
 
@@ -249,24 +249,24 @@ struct GoodsEntry {
 
	NodeID node;            ///< ID of node in link graph referring to this goods entry.
 
	FlowStatMap flows;      ///< Planned flows through this station.
 
	uint max_waiting_cargo; ///< Max cargo from this station waiting at any station.
 

	
 
	/**
 
	 * Reports whether a vehicle has ever tried to load the cargo at this station.
 
	 * This does not imply that there was cargo available for loading. Refer to GES_PICKUP for that.
 
	 * This does not imply that there was cargo available for loading. Refer to GES_RATING for that.
 
	 * @return true if vehicle tried to load.
 
	 */
 
	bool HasVehicleEverTriedLoading() const { return this->last_speed != 0; }
 

	
 
	/**
 
	 * Does this cargo have a rating at this station?
 
	 * @return true if the cargo has a rating, i.e. pickup has been attempted.
 
	 * @return true if the cargo has a rating, i.e. cargo has been moved to the station.
 
	 */
 
	inline bool HasRating() const
 
	{
 
		return HasBit(this->acceptance_pickup, GES_PICKUP);
 
		return HasBit(this->status, GES_RATING);
 
	}
 

	
 
	uint GetSumFlowVia(StationID via) const;
 

	
 
	/**
 
	 * Get the best next hop for a cargo packet from station source.
src/station_cmd.cpp
Show inline comments
 
@@ -435,13 +435,13 @@ void UpdateAllStationVirtCoords()
 
 */
 
static uint GetAcceptanceMask(const Station *st)
 
{
 
	uint mask = 0;
 

	
 
	for (CargoID i = 0; i < NUM_CARGO; i++) {
 
		if (HasBit(st->goods[i].acceptance_pickup, GoodsEntry::GES_ACCEPTANCE)) mask |= 1 << i;
 
		if (HasBit(st->goods[i].status, GoodsEntry::GES_ACCEPTANCE)) mask |= 1 << i;
 
	}
 
	return mask;
 
}
 

	
 
/**
 
 * Items contains the two cargo names that are to be accepted or rejected.
 
@@ -578,13 +578,13 @@ void UpdateStationAcceptance(Station *st
 
		if ((!is_passengers && !(st->facilities & ~FACIL_BUS_STOP)) ||
 
				(is_passengers && !(st->facilities & ~FACIL_TRUCK_STOP))) {
 
			amt = 0;
 
		}
 

	
 
		GoodsEntry &ge = st->goods[i];
 
		SB(ge.acceptance_pickup, GoodsEntry::GES_ACCEPTANCE, 1, amt >= 8);
 
		SB(ge.status, GoodsEntry::GES_ACCEPTANCE, 1, amt >= 8);
 
		if (LinkGraph::IsValidID(ge.link_graph)) {
 
			(*LinkGraph::Get(ge.link_graph))[ge.node].SetDemand(amt / 8);
 
		}
 
	}
 

	
 
	/* Only show a message in case the acceptance was actually changed. */
 
@@ -3188,13 +3188,13 @@ static VehicleEnterTileStatus VehicleEnt
 
 */
 
void TriggerWatchedCargoCallbacks(Station *st)
 
{
 
	/* Collect cargoes accepted since the last big tick. */
 
	uint cargoes = 0;
 
	for (CargoID cid = 0; cid < NUM_CARGO; cid++) {
 
		if (HasBit(st->goods[cid].acceptance_pickup, GoodsEntry::GES_ACCEPTED_BIGTICK)) SetBit(cargoes, cid);
 
		if (HasBit(st->goods[cid].status, GoodsEntry::GES_ACCEPTED_BIGTICK)) SetBit(cargoes, cid);
 
	}
 

	
 
	/* Anything to do? */
 
	if (cargoes == 0) return;
 

	
 
	/* Loop over all houses in the catchment. */
 
@@ -3221,13 +3221,13 @@ static bool StationHandleBigTick(BaseSta
 
	}
 

	
 
	if (Station::IsExpected(st)) {
 
		TriggerWatchedCargoCallbacks(Station::From(st));
 

	
 
		for (CargoID i = 0; i < NUM_CARGO; i++) {
 
			ClrBit(Station::From(st)->goods[i].acceptance_pickup, GoodsEntry::GES_ACCEPTED_BIGTICK);
 
			ClrBit(Station::From(st)->goods[i].status, GoodsEntry::GES_ACCEPTED_BIGTICK);
 
		}
 
	}
 

	
 

	
 
	if ((st->facilities & FACIL_WAYPOINT) == 0) UpdateStationAcceptance(Station::From(st), true);
 

	
 
@@ -3618,14 +3618,14 @@ void StationMonthlyLoop()
 
{
 
	Station *st;
 

	
 
	FOR_ALL_STATIONS(st) {
 
		for (CargoID i = 0; i < NUM_CARGO; i++) {
 
			GoodsEntry *ge = &st->goods[i];
 
			SB(ge->acceptance_pickup, GoodsEntry::GES_LAST_MONTH, 1, GB(ge->acceptance_pickup, GoodsEntry::GES_CURRENT_MONTH, 1));
 
			ClrBit(ge->acceptance_pickup, GoodsEntry::GES_CURRENT_MONTH);
 
			SB(ge->status, GoodsEntry::GES_LAST_MONTH, 1, GB(ge->status, GoodsEntry::GES_CURRENT_MONTH, 1));
 
			ClrBit(ge->status, GoodsEntry::GES_CURRENT_MONTH);
 
		}
 
	}
 
}
 

	
 

	
 
void ModifyStationRatingAround(TileIndex tile, Owner owner, int amount, uint radius)
 
@@ -3635,13 +3635,13 @@ void ModifyStationRatingAround(TileIndex
 
	FOR_ALL_STATIONS(st) {
 
		if (st->owner == owner &&
 
				DistanceManhattan(tile, st->xy) <= radius) {
 
			for (CargoID i = 0; i < NUM_CARGO; i++) {
 
				GoodsEntry *ge = &st->goods[i];
 

	
 
				if (ge->acceptance_pickup != 0) {
 
				if (ge->status != 0) {
 
					ge->rating = Clamp(ge->rating + amount, 0, 255);
 
				}
 
			}
 
		}
 
	}
 
}
 
@@ -3676,13 +3676,13 @@ static uint UpdateStationWaiting(Station
 
		lg = LinkGraph::Get(ge.link_graph);
 
	}
 
	if (lg != NULL) (*lg)[ge.node].UpdateSupply(amount);
 

	
 
	if (!ge.HasRating()) {
 
		InvalidateWindowData(WC_STATION_LIST, st->index);
 
		SetBit(ge.acceptance_pickup, GoodsEntry::GES_PICKUP);
 
		SetBit(ge.status, GoodsEntry::GES_RATING);
 
	}
 

	
 
	TriggerStationRandomisation(st, st->xy, SRT_NEW_CARGO, type);
 
	TriggerStationAnimation(st, st->xy, SAT_NEW_CARGO, type);
 
	AirportAnimationTrigger(st, AAT_STATION_NEW_CARGO, type);
 

	
src/station_gui.cpp
Show inline comments
 
@@ -1795,13 +1795,13 @@ struct StationViewWindow : public Window
 
	int DrawAcceptedCargo(const Rect &r) const
 
	{
 
		const Station *st = Station::Get(this->window_number);
 

	
 
		uint32 cargo_mask = 0;
 
		for (CargoID i = 0; i < NUM_CARGO; i++) {
 
			if (HasBit(st->goods[i].acceptance_pickup, GoodsEntry::GES_ACCEPTANCE)) SetBit(cargo_mask, i);
 
			if (HasBit(st->goods[i].status, GoodsEntry::GES_ACCEPTANCE)) SetBit(cargo_mask, i);
 
		}
 
		SetDParam(0, cargo_mask);
 
		int bottom = DrawStringMultiLine(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, r.top + WD_FRAMERECT_TOP, INT32_MAX, STR_STATION_VIEW_ACCEPTS_CARGO);
 
		return CeilDiv(bottom - r.top - WD_FRAMERECT_TOP, FONT_HEIGHT_NORMAL);
 
	}
 

	
0 comments (0 inline, 0 general)