diff options
author | tron <tron@openttd.org> | 2007-01-17 20:34:29 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2007-01-17 20:34:29 +0000 |
commit | f3daa56208efe9d46aa60e91c44c293d85844601 (patch) | |
tree | 59c354392813dddde5c85f27f29997d73f063688 /src | |
parent | 0eb5af76d1fd94d9ac96abd5cf3a223837736eb8 (diff) | |
download | openttd-f3daa56208efe9d46aa60e91c44c293d85844601.tar.xz |
(svn r8203) -Fix:
Use initialisers, reduce variable scope, remove spurious whitespace, fix format string to make it readable
Diffstat (limited to 'src')
-rw-r--r-- | src/station.cpp | 22 | ||||
-rw-r--r-- | src/station.h | 2 |
2 files changed, 12 insertions, 12 deletions
diff --git a/src/station.cpp b/src/station.cpp index e23439eb0..2330df237 100644 --- a/src/station.cpp +++ b/src/station.cpp @@ -348,16 +348,16 @@ void RoadStop::operator delete(void *p, int index) } /** Initializes a RoadStop */ -RoadStop::RoadStop(TileIndex tile, StationID index) +RoadStop::RoadStop(TileIndex tile, StationID index) : + xy(tile), + used(true), + status(3), // stop is free + num_vehicles(0), + station(index), + next(NULL), + prev(NULL) { DEBUG(ms, cDebugCtorLevel, "I+%3d at %d[0x%x]", index, tile, tile); - xy = tile; - used = true; - status = 3; //stop is free - next = NULL; - prev = NULL; - station = index; - num_vehicles = 0; } /** De-Initializes a RoadStops. This includes clearing all slots that vehicles might @@ -365,10 +365,10 @@ RoadStop::RoadStop(TileIndex tile, StationID index) */ RoadStop::~RoadStop() { - Vehicle *v; - /* Clear the slot assignment of all vehicles heading for this road stop */ if (num_vehicles != 0) { + Vehicle *v; + FOR_ALL_VEHICLES(v) { if (v->type == VEH_Road && v->u.road.slot == this) ClearSlot(v); } @@ -379,7 +379,7 @@ RoadStop::~RoadStop() if (next != NULL) next->prev = prev; used = false; - DEBUG(ms, cDebugCtorLevel , "I- at %3d%d[0x%x]", station, xy, xy); + DEBUG(ms, cDebugCtorLevel , "I-%3d at %d[0x%x]", station, xy, xy); xy = INVALID_TILE; station = INVALID_STATION; diff --git a/src/station.h b/src/station.h index dc86f689f..d7f6246f6 100644 --- a/src/station.h +++ b/src/station.h @@ -66,7 +66,7 @@ typedef struct RoadStop { void *operator new (size_t size, int index); void operator delete(void *rs, int index); - static RoadStop *AllocateRaw( void ); + static RoadStop *AllocateRaw(void); } RoadStop; typedef struct StationSpecList { |