Changeset - r5792:292ddd37504e
[Not reviewed]
master
0 3 0
bjarni - 17 years ago 2007-01-22 16:16:52
bjarni@openttd.org
(svn r8349) -Codechange: replaced CMD_REFIT_VEH() and similar defines with real static inline functions
3 files changed with 59 insertions and 25 deletions:
0 comments (0 inline, 0 general)
src/vehicle.cpp
Show inline comments
 
@@ -20,73 +20,64 @@
 
#include "player.h"
 
#include "engine.h"
 
#include "sound.h"
 
#include "debug.h"
 
#include "vehicle_gui.h"
 
#include "depot.h"
 
#include "station.h"
 
#include "rail.h"
 
#include "train.h"
 
#include "aircraft.h"
 
#include "industry_map.h"
 
#include "station_map.h"
 
#include "water_map.h"
 
#include "network/network.h"
 
#include "yapf/yapf.h"
 
#include "date.h"
 
#include "newgrf_callbacks.h"
 
#include "newgrf_engine.h"
 
#include "newgrf_sound.h"
 
#include "helpers.hpp"
 

	
 
#define INVALID_COORD (-0x8000)
 
#define GEN_HASH(x, y) ((GB((y), 6, 6) << 6) + GB((x), 7, 6))
 

	
 
/*
 
 * These command macros are used to call vehicle type specific commands with non type specific commands
 
 * it should be used like: DoCommandP(x, y, p1, p2, flags, CMD_STARTSTOP_VEH(v->type))
 
 * that line will start/stop a vehicle nomatter what type it is
 
 * VEH_Train is used as an offset because the vehicle type values doesn't start with 0
 
 */
 

	
 
#define CMD_BUILD_VEH(x) _veh_build_proc_table[ x - VEH_Train]
 
#define CMD_SELL_VEH(x)  _veh_sell_proc_table [ x - VEH_Train]
 
#define CMD_REFIT_VEH(x) _veh_refit_proc_table[ x - VEH_Train]
 

	
 
static const uint32 _veh_build_proc_table[] = {
 

	
 
/* Tables used in vehicle.h to find the right command for a certain vehicle type */
 
const uint32 _veh_build_proc_table[] = {
 
	CMD_BUILD_RAIL_VEHICLE,
 
	CMD_BUILD_ROAD_VEH,
 
	CMD_BUILD_SHIP,
 
	CMD_BUILD_AIRCRAFT,
 
};
 
static const uint32 _veh_sell_proc_table[] = {
 
const uint32 _veh_sell_proc_table[] = {
 
	CMD_SELL_RAIL_WAGON,
 
	CMD_SELL_ROAD_VEH,
 
	CMD_SELL_SHIP,
 
	CMD_SELL_AIRCRAFT,
 
};
 

	
 
static const uint32 _veh_refit_proc_table[] = {
 
const uint32 _veh_refit_proc_table[] = {
 
	CMD_REFIT_RAIL_VEHICLE,
 
	CMD_REFIT_ROAD_VEH,
 
	CMD_REFIT_SHIP,
 
	CMD_REFIT_AIRCRAFT,
 
};
 

	
 
const uint32 _send_to_depot_proc_table[] = {
 
	CMD_SEND_TRAIN_TO_DEPOT,
 
	CMD_SEND_ROADVEH_TO_DEPOT,
 
	CMD_SEND_SHIP_TO_DEPOT,
 
	CMD_SEND_AIRCRAFT_TO_HANGAR,
 
};
 

	
 

	
 
enum {
 
	BLOCKS_FOR_SPECIAL_VEHICLES   = 2, ///< Blocks needed for special vehicles
 
};
 

	
 
/**
 
 * Called if a new block is added to the vehicle-pool
 
 */
 
static void VehiclePoolNewBlock(uint start_item)
 
{
 
	Vehicle *v;
 
@@ -1808,62 +1799,62 @@ int32 CmdCloneVehicle(TileIndex tile, ui
 

	
 
	if (v->type == VEH_Train && (!IsFrontEngine(v) || v->u.rail.crash_anim_pos >= 4400)) return CMD_ERROR;
 

	
 
	// check that we can allocate enough vehicles
 
	if (!(flags & DC_EXEC)) {
 
		int veh_counter = 0;
 
		do {
 
			veh_counter++;
 
		} while ((v = v->next) != NULL);
 

	
 
		if (!AllocateVehicles(NULL, veh_counter)) {
 
			return_cmd_error(STR_00E1_TOO_MANY_VEHICLES_IN_GAME);
 
		}
 
	}
 

	
 
	v = v_front;
 

	
 
	do {
 

	
 
		if (IsMultiheaded(v) && !IsTrainEngine(v)) {
 
			/* we build the rear ends of multiheaded trains with the front ones */
 
			continue;
 
		}
 

	
 
		cost = DoCommand(tile, v->engine_type, build_argument, flags, CMD_BUILD_VEH(v->type));
 
		cost = DoCommand(tile, v->engine_type, build_argument, flags, GetCmdBuildVeh(v));
 
		build_argument = 3; // ensure that we only assign a number to the first engine
 

	
 
		if (CmdFailed(cost)) return cost;
 

	
 
		total_cost += cost;
 

	
 
		if (flags & DC_EXEC) {
 
			w = GetVehicle(_new_vehicle_id);
 

	
 
			if (v->cargo_type != w->cargo_type || v->cargo_subtype != w->cargo_subtype) {
 
				// we can't pay for refitting because we can't estimate refitting costs for a vehicle before it's build
 
				// if we pay for it anyway, the cost and the estimated cost will not be the same and we will have an assert
 
				DoCommand(0, w->index, v->cargo_type | (v->cargo_subtype << 8), flags, CMD_REFIT_VEH(v->type));
 
				DoCommand(0, w->index, v->cargo_type | (v->cargo_subtype << 8), flags, GetCmdRefitVeh(v));
 
			}
 
			if (v->type == VEH_Train && HASBIT(v->u.rail.flags, VRF_REVERSE_DIRECTION)) {
 
				SETBIT(w->u.rail.flags, VRF_REVERSE_DIRECTION);
 
			}
 

	
 
			if (v->type == VEH_Train && !IsFrontEngine(v)) {
 
				// this s a train car
 
				// add this unit to the end of the train
 
				DoCommand(0, (w_rear->index << 16) | w->index, 1, flags, CMD_MOVE_RAIL_VEHICLE);
 
			} else {
 
				// this is a front engine or not a train. It need orders
 
				w_front = w;
 
				w->service_interval = v->service_interval;
 
				DoCommand(0, (v->index << 16) | w->index, p2 & 1 ? CO_SHARE : CO_COPY, flags, CMD_CLONE_ORDER);
 
			}
 
			w_rear = w; // trains needs to know the last car in the train, so they can add more in next loop
 
		}
 
	} while (v->type == VEH_Train && (v = GetNextVehicle(v)) != NULL);
 

	
 
	if (flags & DC_EXEC && v_front->type == VEH_Train) {
 
		// for trains this needs to be the front engine due to the callback function
 
		_new_vehicle_id = w_front->index;
 
	}
 

	
 
@@ -2003,72 +1994,72 @@ static CargoID GetNewCargoTypeForReplace
 
 * @param flags is the flags to use when calling DoCommand(). Mainly DC_EXEC counts
 
 * @return value is cost of the replacement or CMD_ERROR
 
 */
 
static int32 ReplaceVehicle(Vehicle **w, byte flags, int32 total_cost)
 
{
 
	int32 cost;
 
	int32 sell_value;
 
	Vehicle *old_v = *w;
 
	const Player *p = GetPlayer(old_v->owner);
 
	EngineID new_engine_type;
 
	const UnitID cached_unitnumber = old_v->unitnumber;
 
	bool new_front = false;
 
	Vehicle *new_v = NULL;
 
	char vehicle_name[32];
 
	CargoID replacement_cargo_type;
 

	
 
	new_engine_type = EngineReplacementForPlayer(p, old_v->engine_type);
 
	if (new_engine_type == INVALID_ENGINE) new_engine_type = old_v->engine_type;
 

	
 
	replacement_cargo_type = GetNewCargoTypeForReplace(old_v, new_engine_type);
 

	
 
	/* check if we can't refit to the needed type, so no replace takes place to prevent the vehicle from altering cargo type */
 
	if (replacement_cargo_type == CT_INVALID) return 0;
 

	
 
	sell_value = DoCommand(0, old_v->index, 0, DC_QUERY_COST, CMD_SELL_VEH(old_v->type));
 
	sell_value = DoCommand(0, old_v->index, 0, DC_QUERY_COST, GetCmdSellVeh(old_v));
 

	
 
	/* We give the player a loan of the same amount as the sell value.
 
	 * This is needed in case he needs the income from the sale to build the new vehicle.
 
	 * We take it back if building fails or when we really sell the old engine */
 
	SET_EXPENSES_TYPE(EXPENSES_NEW_VEHICLES);
 
	SubtractMoneyFromPlayer(sell_value);
 

	
 
	cost = DoCommand(old_v->tile, new_engine_type, 3, flags, CMD_BUILD_VEH(old_v->type));
 
	cost = DoCommand(old_v->tile, new_engine_type, 3, flags, GetCmdBuildVeh(old_v));
 
	if (CmdFailed(cost)) {
 
		SET_EXPENSES_TYPE(EXPENSES_NEW_VEHICLES);
 
		SubtractMoneyFromPlayer(-sell_value); // Take back the money we just gave the player
 
		return cost;
 
	}
 

	
 
	if (replacement_cargo_type != CT_NO_REFIT) cost += GetRefitCost(new_engine_type); // add refit cost
 

	
 
	if (flags & DC_EXEC) {
 
		new_v = GetVehicle(_new_vehicle_id);
 
		*w = new_v; //we changed the vehicle, so MaybeReplaceVehicle needs to work on the new one. Now we tell it what the new one is
 

	
 
		/* refit if needed */
 
		if (replacement_cargo_type != CT_NO_REFIT) {
 
			if (CmdFailed(DoCommand(0, new_v->index, replacement_cargo_type, DC_EXEC, CMD_REFIT_VEH(new_v->type)))) {
 
			if (CmdFailed(DoCommand(0, new_v->index, replacement_cargo_type, DC_EXEC, GetCmdRefitVeh(new_v)))) {
 
				/* Being here shows a failure, which most likely is in GetNewCargoTypeForReplace() or incorrect estimation costs */
 
				error("Autoreplace failed to refit. Replace engine %d to %d and refit to cargo %d", old_v->engine_type, new_v->engine_type, replacement_cargo_type);
 
			}
 
		}
 

	
 
		if (new_v->type == VEH_Train && HASBIT(old_v->u.rail.flags, VRF_REVERSE_DIRECTION) && !IsMultiheaded(new_v) && !(new_v->next != NULL && IsArticulatedPart(new_v->next))) {
 
			// we are autorenewing to a single engine, so we will turn it as the old one was turned as well
 
			SETBIT(new_v->u.rail.flags, VRF_REVERSE_DIRECTION);
 
		}
 

	
 
		if (old_v->type == VEH_Train && !IsFrontEngine(old_v)) {
 
			/* this is a railcar. We need to move the car into the train
 
			 * We add the new engine after the old one instead of replacing it. It will give the same result anyway when we
 
			 * sell the old engine in a moment
 
			 */
 
			DoCommand(0, (GetPrevVehicleInChain(old_v)->index << 16) | new_v->index, 1, DC_EXEC, CMD_MOVE_RAIL_VEHICLE);
 
			/* Now we move the old one out of the train */
 
			DoCommand(0, (INVALID_VEHICLE << 16) | old_v->index, 0, DC_EXEC, CMD_MOVE_RAIL_VEHICLE);
 
		} else {
 
			// copy/clone the orders
 
			DoCommand(0, (old_v->index << 16) | new_v->index, IsOrderListShared(old_v) ? CO_SHARE : CO_COPY, DC_EXEC, CMD_CLONE_ORDER);
 
			new_v->cur_order_index = old_v->cur_order_index;
 
			ChangeVehicleViewWindow(old_v, new_v);
 
			new_v->profit_this_year = old_v->profit_this_year;
 
@@ -2096,49 +2087,49 @@ static int32 ReplaceVehicle(Vehicle **w,
 
		MoveVehicleCargo(new_v->type == VEH_Train ? GetFirstVehicleInChain(new_v) : new_v, old_v);
 

	
 
		// Get the name of the old vehicle if it has a custom name.
 
		if (!IsCustomName(old_v->string_id)) {
 
			vehicle_name[0] = '\0';
 
		} else {
 
			GetName(vehicle_name, old_v->string_id & 0x7FF, lastof(vehicle_name));
 
		}
 
	} else { // flags & DC_EXEC not set
 
		/* Ensure that the player will not end up having negative money while autoreplacing
 
		 * This is needed because the only other check is done after the income from selling the old vehicle is substracted from the cost */
 
		if (p->money64 < (cost + total_cost)) {
 
			SET_EXPENSES_TYPE(EXPENSES_NEW_VEHICLES);
 
			SubtractMoneyFromPlayer(-sell_value); // Pay back the loan
 
			return CMD_ERROR;
 
		}
 
	}
 

	
 
	/* Take back the money we just gave the player just before building the vehicle
 
	 * The player will get the same amount now that the sale actually takes place */
 
	SET_EXPENSES_TYPE(EXPENSES_NEW_VEHICLES);
 
	SubtractMoneyFromPlayer(-sell_value);
 

	
 
	/* sell the engine/ find out how much you get for the old engine (income is returned as negative cost) */
 
	cost += DoCommand(0, old_v->index, 0, flags, CMD_SELL_VEH(old_v->type));
 
	cost += DoCommand(0, old_v->index, 0, flags, GetCmdSellVeh(old_v));
 

	
 
	if (new_front) {
 
		/* now we assign the old unitnumber to the new vehicle */
 
		new_v->unitnumber = cached_unitnumber;
 
	}
 

	
 
	/* Transfer the name of the old vehicle */
 
	if ((flags & DC_EXEC) && vehicle_name[0] != '\0') {
 
		_cmd_text = vehicle_name;
 
		DoCommand(0, new_v->index, 0, DC_EXEC, CMD_NAME_VEHICLE);
 
	}
 

	
 
	return cost;
 
}
 

	
 
/** replaces a vehicle if it's set for autoreplace or is too old
 
 * (used to be called autorenew)
 
 * @param v The vehicle to replace
 
 * if the vehicle is a train, v needs to be the front engine
 
 * @param check Checks if the replace is valid. No action is done at all
 
 * @param display_costs If set, a cost animation is shown (only if check is false)
 
 * @return CMD_ERROR if something went wrong. Otherwise the price of the replace
 
 */
 
static int32 MaybeReplaceVehicle(Vehicle *v, bool check, bool display_costs)
 
@@ -2456,49 +2447,49 @@ uint GenerateVehicleSortList(const Vehic
 
	}
 

	
 
	return n;
 
}
 

	
 
/** send all vehicles of type to depots
 
 * @param type type of vehicle
 
 * @param flags the flags used for DoCommand()
 
 * @param service should the vehicles only get service in the depots
 
 * @param owner PlayerID of owner of the vehicles to send
 
 * @param VLW_flag tells what kind of list requested the goto depot
 
 * @return 0 for success and CMD_ERROR if no vehicle is able to go to depot
 
 */
 
int32 SendAllVehiclesToDepot(byte type, uint32 flags, bool service, PlayerID owner, uint16 vlw_flag, uint32 id)
 
{
 
	const Vehicle **sort_list = NULL;
 
	uint n, i;
 
	uint16 array_length = 0;
 

	
 
	n = GenerateVehicleSortList(&sort_list, &array_length, type, owner, id, vlw_flag);
 

	
 
	/* Send all the vehicles to a depot */
 
	for (i = 0; i < n; i++) {
 
		const Vehicle *v = sort_list[i];
 
		int32 ret = DoCommand(v->tile, v->index, (service ? 1 : 0) | DEPOT_DONT_CANCEL, flags, CMD_SEND_TO_DEPOT(type));
 
		int32 ret = DoCommand(v->tile, v->index, (service ? 1 : 0) | DEPOT_DONT_CANCEL, flags, GetCmdSendToDepot(type));
 

	
 
		/* Return 0 if DC_EXEC is not set this is a valid goto depot command)
 
			* In this case we know that at least one vehicle can be sent to a depot
 
			* and we will issue the command. We can now safely quit the loop, knowing
 
			* it will succeed at least once. With DC_EXEC we really need to send them to the depot */
 
		if (!CmdFailed(ret) && !(flags & DC_EXEC)) {
 
			free((void*)sort_list);
 
			return 0;
 
		}
 
	}
 

	
 
	free((void*)sort_list);
 
	return (flags & DC_EXEC) ? 0 : CMD_ERROR;
 
}
 

	
 
bool IsVehicleInDepot(const Vehicle *v)
 
{
 
	switch (v->type) {
 
		case VEH_Train:    return CheckTrainInDepot(v, false) != -1;
 
		case VEH_Road:     return IsRoadVehInDepot(v);
 
		case VEH_Ship:     return IsShipInDepot(v);
 
		case VEH_Aircraft: return IsAircraftInHangar(v);
 
		default: NOT_REACHED();
 
	}
 
@@ -2539,49 +2530,49 @@ void VehicleEnterDepot(Vehicle *v)
 
		InvalidateWindowData(WC_VEHICLE_DEPOT, v->tile);
 
	}
 
	InvalidateWindow(WC_VEHICLE_DEPOT, v->tile);
 

	
 
	v->vehstatus |= VS_HIDDEN;
 
	v->cur_speed = 0;
 

	
 
	VehicleServiceInDepot(v);
 

	
 
	TriggerVehicle(v, VEHICLE_TRIGGER_DEPOT);
 

	
 
	if (v->current_order.type == OT_GOTO_DEPOT) {
 
		Order t;
 

	
 
		InvalidateWindow(WC_VEHICLE_VIEW, v->index);
 

	
 
		t = v->current_order;
 
		v->current_order.type = OT_DUMMY;
 
		v->current_order.flags = 0;
 

	
 
		if (t.refit_cargo < NUM_CARGO) {
 
			int32 cost;
 

	
 
			_current_player = v->owner;
 
			cost = DoCommand(v->tile, v->index, t.refit_cargo | t.refit_subtype << 8, DC_EXEC, CMD_REFIT_VEH(v->type));
 
			cost = DoCommand(v->tile, v->index, t.refit_cargo | t.refit_subtype << 8, DC_EXEC, GetCmdRefitVeh(v));
 

	
 
			if (CmdFailed(cost)) {
 
				v->leave_depot_instantly = false; // We ensure that the vehicle stays in the depot
 
				if (v->owner == _local_player) {
 
					/* Notify the user that we stopped the vehicle */
 
					SetDParam(0, _vehicle_type_names[v->type - 0x10]);
 
					SetDParam(1, v->unitnumber);
 
					AddNewsItem(STR_ORDER_REFIT_FAILED, NEWS_FLAGS(NM_SMALL, NF_VIEWPORT|NF_VEHICLE, NT_ADVICE, 0), v->index, 0);
 
				}
 
			} else if (v->owner == _local_player && cost != 0) {
 
				ShowCostOrIncomeAnimation(v->x_pos, v->y_pos, v->z_pos, cost);
 
			}
 
		}
 

	
 
		if (HASBIT(t.flags, OFB_PART_OF_ORDERS)) {
 
			/* Part of orders */
 
			if (v->type == VEH_Train) v->u.rail.days_since_order_progr = 0;
 
			v->cur_order_index++;
 
		} else if (HASBIT(t.flags, OFB_HALT_IN_DEPOT)) {
 
			/* Force depot visit */
 
			v->vehstatus |= VS_STOPPED;
 
			if (v->owner == _local_player) {
 
				StringID string;
 

	
src/vehicle.h
Show inline comments
 
@@ -490,28 +490,71 @@ static inline Vehicle *GetFirstVehicleFr
 
VARDEF VehicleID _new_vehicle_id;
 
VARDEF uint16 _returned_refit_capacity;
 

	
 
static const VehicleID INVALID_VEHICLE = 0xFFFF;
 

	
 
/**
 
 * Get the colour map for an engine. This used for unbuilt engines in the user interface.
 
 * @param engine_type ID of engine
 
 * @param player ID of player
 
 * @return A ready-to-use palette modifier
 
 */
 
SpriteID GetEnginePalette(EngineID engine_type, PlayerID player);
 

	
 
/**
 
 * Get the colour map for a vehicle.
 
 * @param v Vehicle to get colour map for
 
 * @return A ready-to-use palette modifier
 
 */
 
SpriteID GetVehiclePalette(const Vehicle *v);
 

	
 
/* A lot of code calls for the invalidation of the status bar, which is widget 5.
 
 * Best is to have a virtual value for it when it needs to change again */
 
#define STATUS_BAR 5
 

	
 
extern const uint32 _veh_build_proc_table[];
 
extern const uint32 _veh_sell_proc_table[];
 
extern const uint32 _veh_refit_proc_table[];
 
extern const uint32 _send_to_depot_proc_table[];
 
#define CMD_SEND_TO_DEPOT(x) _send_to_depot_proc_table[ x - VEH_Train]
 

	
 
/* Functions to find the right command for certain vehicle type */
 
static inline uint32 GetCmdBuildVeh(byte type)
 
{
 
	return _veh_build_proc_table[VehTypeToIndex(type)];
 
}
 

	
 
static inline uint32 GetCmdBuildVeh(const Vehicle *v)
 
{
 
	return GetCmdBuildVeh(v->type);
 
}
 

	
 
static inline uint32 GetCmdSellVeh(byte type)
 
{
 
	return _veh_sell_proc_table[VehTypeToIndex(type)];
 
}
 

	
 
static inline uint32 GetCmdSellVeh(const Vehicle *v)
 
{
 
	return GetCmdSellVeh(v->type);
 
}
 

	
 
static inline uint32 GetCmdRefitVeh(byte type)
 
{
 
	return _veh_refit_proc_table[VehTypeToIndex(type)];
 
}
 

	
 
static inline uint32 GetCmdRefitVeh(const Vehicle *v)
 
{
 
	return GetCmdRefitVeh(v->type);
 
}
 

	
 
static inline uint32 GetCmdSendToDepot(byte type)
 
{
 
	return _send_to_depot_proc_table[VehTypeToIndex(type)];
 
}
 

	
 
static inline uint32 GetCmdSendToDepot(const Vehicle *v)
 
{
 
	return GetCmdSendToDepot(v->type);
 
}
 

	
 
#endif /* VEHICLE_H */
src/vehicle_gui.cpp
Show inline comments
 
@@ -1756,55 +1756,55 @@ void PlayerVehWndProc(Window *w, WindowE
 
			}
 
		}	break;
 

	
 
		case WE_DROPDOWN_SELECT: /* we have selected a dropdown item in the list */
 
			switch (e->we.dropdown.button) {
 
				case VLW_WIDGET_SORT_BY_PULLDOWN:
 
					if (vl->l.sort_type != e->we.dropdown.index) {
 
						// value has changed -> resort
 
						vl->l.flags |= VL_RESORT;
 
						vl->l.sort_type = e->we.dropdown.index;
 
						vl->_sorting->criteria = vl->l.sort_type;
 
					}
 
					break;
 
				case VLW_WIDGET_MANAGE_VEHICLES_DROPDOWN:
 
					assert(vl->l.list_length != 0);
 

	
 
					switch (e->we.dropdown.index) {
 
						case 0: /* Replace window */
 
							ShowReplaceVehicleWindow(vl->vehicle_type);
 
							break;
 
						case 1: /* Send for servicing */
 
							DoCommandP(0, GB(w->window_number, 16, 16) /* StationID or OrderID (depending on VLW) */,
 
								(w->window_number & VLW_MASK) | DEPOT_MASS_SEND | DEPOT_SERVICE,
 
								NULL,
 
								CMD_SEND_TO_DEPOT(vl->vehicle_type));
 
								GetCmdSendToDepot(vl->vehicle_type));
 
							break;
 
						case 2: /* Send to Depots */
 
							DoCommandP(0, GB(w->window_number, 16, 16) /* StationID or OrderID (depending on VLW) */,
 
								(w->window_number & VLW_MASK) | DEPOT_MASS_SEND,
 
								NULL,
 
								CMD_SEND_TO_DEPOT(vl->vehicle_type));
 
								GetCmdSendToDepot(vl->vehicle_type));
 
							break;
 

	
 
						default: NOT_REACHED();
 
					}
 
					break;
 
				default: NOT_REACHED();
 
			}
 
			SetWindowDirty(w);
 
			break;
 

	
 
		case WE_DESTROY:
 
			free((void*)vl->sort_list);
 
			break;
 

	
 
		case WE_TICK: /* resort the list every 20 seconds orso (10 days) */
 
			if (--vl->l.resort_timer == 0) {
 
				StationID station = ((w->window_number & VLW_MASK) == VLW_STATION_LIST) ? GB(w->window_number, 16, 16) : INVALID_STATION;
 
				PlayerID owner = (PlayerID)w->caption_color;
 

	
 
				DEBUG(misc, 3, "Periodic resort %d list player %d at station %d", vl->vehicle_type, owner, station);
 
				vl->l.resort_timer = DAY_TICKS * PERIODIC_RESORT_DAYS;
 
				vl->l.flags |= VL_RESORT;
 
				SetWindowDirty(w);
 
			}
0 comments (0 inline, 0 general)