station_map.c
author bjarni
Mon, 14 Aug 2006 15:03:01 +0000
changeset 4262 4657d940a84c
parent 3882 86380e989bad
permissions -rw-r--r--
(svn r5888) -Fix: [autoreplace] if vehicles breakdowns and service are turned off, the vehicles failed to enter any depots
now they will quickly go to a depot if set to be replaced
the tradeoff is that a vehicle set to be replaced and without a depot in the orders will forget about the orders and head for a depot. If the replace fails (lack of money), it will exit and try to head for the depot again
also all vehicles of that type will rush to the depots at once, risking causing traffic jams. This is because there is no way to even it out like normal depot visits offers
Tip: add a depot to the orders of all vehicles, set it to service only and it will always be skipped unless the vehicle is set to be replaced. This should help on the jam issue and if the replace fails, the vehicle will go though a whole round of the orders and make more money before trying again
3334
b72ac8637a30 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
diff changeset
     1
/* $Id$ */
b72ac8637a30 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
diff changeset
     2
b72ac8637a30 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
diff changeset
     3
#include "stdafx.h"
b72ac8637a30 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
diff changeset
     4
#include "openttd.h"
b72ac8637a30 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
diff changeset
     5
#include "station_map.h"
b72ac8637a30 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
diff changeset
     6
b72ac8637a30 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
diff changeset
     7
b72ac8637a30 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
diff changeset
     8
StationType GetStationType(TileIndex t)
b72ac8637a30 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
diff changeset
     9
{
b72ac8637a30 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
diff changeset
    10
	assert(IsTileType(t, MP_STATION));
b72ac8637a30 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
diff changeset
    11
	if (IsRailwayStation(t)) return STATION_RAIL;
b72ac8637a30 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
diff changeset
    12
	if (IsAirport(t)) return STATION_AIRPORT;
b72ac8637a30 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
diff changeset
    13
	if (IsTruckStop(t)) return STATION_TRUCK;
b72ac8637a30 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
diff changeset
    14
	if (IsBusStop(t)) return STATION_BUS;
b72ac8637a30 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
diff changeset
    15
	if (IsOilRig(t)) return STATION_OILRIG;
b72ac8637a30 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
diff changeset
    16
	if (IsDock(t)) return STATION_DOCK;
b72ac8637a30 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
diff changeset
    17
	assert(IsBuoy_(t));
b72ac8637a30 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
diff changeset
    18
	return STATION_BUOY;
b72ac8637a30 (svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
diff changeset
    19
}