From c5c5c9b17c1c4fd543873f866534d3fa06f9f1cb Mon Sep 17 00:00:00 2001 From: matthijs Date: Sun, 6 Feb 2005 22:36:08 +0000 Subject: (svn r1834) - Fix: NPF does not check the owner of its target, busses try to enter other players' depots. TODO - Add: asserts to find the v->u.rail.track == 0 problem. - Add: IsValidDepot(), IsValidTown(), IsValidSign(), IsValidVehicle(), IsValidStation() - Add: GetTileOwner(), IsTileOwner() - Codechange: Replaced IsShipDepotTile(), IsTrainDepotTile(), IsRoadDepotTile() by IsTileDepotType(). - Codechange: typedeffed the MAP_OWNERS as Owner. Should be used as variable type. - Codechange: Replaced a few uint by TileIndex. --- station.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'station.h') diff --git a/station.h b/station.h index 26d22b827..4a4d721b1 100644 --- a/station.h +++ b/station.h @@ -272,6 +272,14 @@ static inline bool IsRoadStationTile(uint tile) { return IsTileType(tile, MP_STATION) && IS_BYTE_INSIDE(_map5[tile], 0x43, 0x4B); } +/** + * Check if a station really exists. + */ +static inline bool IsValidStation(Station* station) +{ + return station->xy != 0; /* XXX: Replace by INVALID_TILE someday */ +} + /* Get's the direction the station exit points towards. Ie, returns 0 for a * station with the exit NE. */ static inline byte GetRoadStationDir(uint tile) { -- cgit v1.2.3-54-g00ecf