diff options
author | frosch <frosch@openttd.org> | 2016-05-29 13:33:20 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2016-05-29 13:33:20 +0000 |
commit | dac94c7cbc6455bd004eb410f384bad205e32dc9 (patch) | |
tree | 4d61b7f7e033ddda964fa83a3cade2f91adc53c9 /src/vehicle.cpp | |
parent | 7d4754a4f86d635104c257b29a58d5488f7ebf4e (diff) | |
download | openttd-dac94c7cbc6455bd004eb410f384bad205e32dc9.tar.xz |
(svn r27584) -Codechange: Add some assertions about Vehicle::cargo_payment.
Diffstat (limited to 'src/vehicle.cpp')
-rw-r--r-- | src/vehicle.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/vehicle.cpp b/src/vehicle.cpp index a482520f2..da2cfeb80 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -216,7 +216,7 @@ uint Vehicle::Crash(bool flooded) SetWindowDirty(WC_VEHICLE_DEPOT, this->tile); delete this->cargo_payment; - this->cargo_payment = NULL; + assert(this->cargo_payment == NULL); // cleared by ~CargoPayment return RandomRange(pass + 1); // Randomise deceased passengers. } @@ -746,6 +746,7 @@ void Vehicle::PreDestructor() HideFillingPercent(&this->fill_percent_te_id); this->CancelReservation(INVALID_STATION, st); delete this->cargo_payment; + assert(this->cargo_payment == NULL); // cleared by ~CargoPayment } if (this->IsEngineCountable()) { @@ -2085,6 +2086,7 @@ void Vehicle::LeaveStation() assert(this->current_order.IsType(OT_LOADING)); delete this->cargo_payment; + assert(this->cargo_payment == NULL); // cleared by ~CargoPayment /* Only update the timetable if the vehicle was supposed to stop here. */ if (this->current_order.GetNonStopType() != ONSF_STOP_EVERYWHERE) UpdateVehicleTimetable(this, false); |