diff options
-rw-r--r-- | src/cargopacket.cpp | 7 | ||||
-rw-r--r-- | src/cargopacket.h | 2 |
2 files changed, 7 insertions, 2 deletions
diff --git a/src/cargopacket.cpp b/src/cargopacket.cpp index f2614c9b7..2360b87cf 100644 --- a/src/cargopacket.cpp +++ b/src/cargopacket.cpp @@ -32,11 +32,16 @@ CargoPacket::CargoPacket() this->source_id = INVALID_SOURCE; } +/* NOTE: We have to zero memory ourselves here because we are using a 'new' + * that, in contrary to all other pools, does not memset to 0. */ CargoPacket::CargoPacket(StationID source, TileIndex source_xy, uint16 count, SourceType source_type, SourceID source_id) : + feeder_share(0), count(count), + days_in_transit(0), source_id(source_id), source(source), - source_xy(source_xy) + source_xy(source_xy), + loaded_at_xy(0) { assert(count != 0); this->source_type = source_type; diff --git a/src/cargopacket.h b/src/cargopacket.h index 8f4663e79..64fd7145a 100644 --- a/src/cargopacket.h +++ b/src/cargopacket.h @@ -25,7 +25,7 @@ typedef uint32 CargoPacketID; struct CargoPacket; /** Type of the pool for cargo packets. */ -typedef Pool<CargoPacket, CargoPacketID, 1024, 1048576> CargoPacketPool; +typedef Pool<CargoPacket, CargoPacketID, 1024, 1048576, true, false> CargoPacketPool; /** The actual pool with cargo packets */ extern CargoPacketPool _cargopacket_pool; |