mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-02-02 12:24:15 +00:00
(svn r16636) -Codechange: no need to initialize already zeroed variables by zero in station and rs constructors, remove debug output
This commit is contained in:
parent
bfe20321e7
commit
33ce857271
@ -30,24 +30,17 @@ INSTANTIATE_POOL_METHODS(Station)
|
||||
RoadStopPool _roadstop_pool("RoadStop");
|
||||
INSTANTIATE_POOL_METHODS(RoadStop)
|
||||
|
||||
Station::Station(TileIndex tile)
|
||||
Station::Station(TileIndex tile) :
|
||||
xy(tile),
|
||||
train_tile(INVALID_TILE),
|
||||
airport_tile(INVALID_TILE),
|
||||
dock_tile(INVALID_TILE),
|
||||
indtype(IT_INVALID),
|
||||
time_since_load(255),
|
||||
time_since_unload(255),
|
||||
last_vehicle_type(VEH_INVALID)
|
||||
{
|
||||
DEBUG(station, cDebugCtorLevel, "I+%3d", index);
|
||||
|
||||
xy = tile;
|
||||
airport_tile = dock_tile = train_tile = INVALID_TILE;
|
||||
bus_stops = truck_stops = NULL;
|
||||
had_vehicle_of_type = 0;
|
||||
time_since_load = 255;
|
||||
time_since_unload = 255;
|
||||
delete_ctr = 0;
|
||||
facilities = 0;
|
||||
|
||||
last_vehicle_type = VEH_INVALID;
|
||||
indtype = IT_INVALID;
|
||||
|
||||
random_bits = 0; // Random() must be called when station is really built (DC_EXEC)
|
||||
waiting_triggers = 0;
|
||||
/* this->random_bits is set in Station::AddFacility() */
|
||||
}
|
||||
|
||||
/**
|
||||
@ -58,8 +51,6 @@ Station::Station(TileIndex tile)
|
||||
*/
|
||||
Station::~Station()
|
||||
{
|
||||
DEBUG(station, cDebugCtorLevel, "I-%3d", index);
|
||||
|
||||
free(this->name);
|
||||
free(this->speclist);
|
||||
|
||||
@ -453,11 +444,8 @@ StationRect& StationRect::operator = (Rect src)
|
||||
/** Initializes a RoadStop */
|
||||
RoadStop::RoadStop(TileIndex tile) :
|
||||
xy(tile),
|
||||
status(3), // stop is free
|
||||
num_vehicles(0),
|
||||
next(NULL)
|
||||
status(3) // stop is free
|
||||
{
|
||||
DEBUG(ms, cDebugCtorLevel, "I+ at %d[0x%x]", tile, tile);
|
||||
}
|
||||
|
||||
/** De-Initializes a RoadStops. This includes clearing all slots that vehicles might
|
||||
@ -475,8 +463,6 @@ RoadStop::~RoadStop()
|
||||
}
|
||||
}
|
||||
assert(num_vehicles == 0);
|
||||
|
||||
DEBUG(ms, cDebugCtorLevel , "I- at %d[0x%x]", xy, xy);
|
||||
}
|
||||
|
||||
/** Checks whether there is a free bay in this road stop */
|
||||
|
@ -51,7 +51,6 @@ struct GoodsEntry {
|
||||
|
||||
/** A Stop for a Road Vehicle */
|
||||
struct RoadStop : RoadStopPool::PoolItem<&_roadstop_pool> {
|
||||
static const int cDebugCtorLevel = 5; ///< Debug level on which Contructor / Destructor messages are printed
|
||||
static const uint LIMIT = 16; ///< The maximum amount of roadstops that are allowed at a single station
|
||||
static const uint MAX_BAY_COUNT = 2; ///< The maximum number of loading bays
|
||||
static const uint MAX_VEHICLES = 64; ///< The maximum number of vehicles that can allocate a slot to this roadstop
|
||||
@ -166,8 +165,6 @@ public:
|
||||
|
||||
StationRect rect; ///< Station spread out rectangle (not saved) maintained by StationRect_xxx() functions
|
||||
|
||||
static const int cDebugCtorLevel = 5;
|
||||
|
||||
Station(TileIndex tile = INVALID_TILE);
|
||||
~Station();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user