(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.
This commit is contained in:
@@ -371,6 +371,14 @@ static inline uint16 GetVehiclePoolSize(void)
|
||||
#define FOR_ALL_VEHICLES_FROM(v, start) for (v = GetVehicle(start); v != NULL; v = (v->index + 1 < GetVehiclePoolSize()) ? GetVehicle(v->index + 1) : NULL)
|
||||
#define FOR_ALL_VEHICLES(v) FOR_ALL_VEHICLES_FROM(v, 0)
|
||||
|
||||
/**
|
||||
* Check if a Vehicle really exists.
|
||||
*/
|
||||
static inline bool IsValidVehicle(Vehicle* v)
|
||||
{
|
||||
return v->type != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if an index is a vehicle-index (so between 0 and max-vehicles)
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user