# HG changeset patch # User tron # Date 1169073154 0 # Node ID ce37296bb03cb2a90b383dc7136604e2d65f95c4 # Parent b6fb89cd9cced8b1fd9e73631a141924ea9bd3f1 (svn r8212) -Fix Remove the unnecessary attribute RoadStop::used. The same information can be derived from RoadStop::xy diff -r b6fb89cd9cce -r ce37296bb03c src/station.cpp --- a/src/station.cpp Wed Jan 17 22:19:12 2007 +0000 +++ b/src/station.cpp Wed Jan 17 22:32:34 2007 +0000 @@ -350,7 +350,6 @@ /** Initializes a RoadStop */ RoadStop::RoadStop(TileIndex tile) : xy(tile), - used(true), status(3), // stop is free num_vehicles(0), next(NULL), @@ -377,7 +376,6 @@ if (prev != NULL) prev->next = next; if (next != NULL) next->prev = prev; - used = false; DEBUG(ms, cDebugCtorLevel , "I- at %d[0x%x]", xy, xy); xy = INVALID_TILE; diff -r b6fb89cd9cce -r ce37296bb03c src/station.h --- a/src/station.h Wed Jan 17 22:19:12 2007 +0000 +++ b/src/station.h Wed Jan 17 22:32:34 2007 +0000 @@ -46,9 +46,8 @@ typedef struct RoadStop { TileIndex xy; - bool used; + RoadStopID index; byte status; - RoadStopID index; byte num_vehicles; struct RoadStop *next; struct RoadStop *prev; @@ -258,7 +257,7 @@ */ static inline bool IsValidRoadStop(const RoadStop *rs) { - return rs->used; + return rs->xy != INVALID_TILE; } #define FOR_ALL_ROADSTOPS_FROM(rs, start) for (rs = GetRoadStop(start); rs != NULL; rs = (rs->index + 1U < GetRoadStopPoolSize()) ? GetRoadStop(rs->index + 1U) : NULL) if (IsValidRoadStop(rs)) diff -r b6fb89cd9cce -r ce37296bb03c src/station_cmd.cpp --- a/src/station_cmd.cpp Wed Jan 17 22:19:12 2007 +0000 +++ b/src/station_cmd.cpp Wed Jan 17 22:32:34 2007 +0000 @@ -68,7 +68,10 @@ /* We don't use FOR_ALL here, because FOR_ALL skips invalid items. * TODO - This is just a temporary stage, this will be removed. */ - for (rs = GetRoadStop(start_item); rs != NULL; rs = (rs->index + 1U < GetRoadStopPoolSize()) ? GetRoadStop(rs->index + 1U) : NULL) rs->index = start_item++; + for (rs = GetRoadStop(start_item); rs != NULL; rs = (rs->index + 1U < GetRoadStopPoolSize()) ? GetRoadStop(rs->index + 1U) : NULL) { + rs->xy = INVALID_TILE; + rs->index = start_item++; + } } DEFINE_OLD_POOL(Station, Station, StationPoolNewBlock, StationPoolCleanBlock) @@ -2847,7 +2850,7 @@ static const SaveLoad _roadstop_desc[] = { SLE_VAR(RoadStop,xy, SLE_UINT32), - SLE_VAR(RoadStop,used, SLE_BOOL), + SLE_CONDNULL(1, 0, 44), SLE_VAR(RoadStop,status, SLE_UINT8), /* Index was saved in some versions, but this is not needed */ SLE_CONDNULL(4, 0, 8),