Changeset - r12366:9b0659d2ff5d
[Not reviewed]
master
0 1 0
rubidium - 15 years ago 2009-07-13 09:15:11
rubidium@openttd.org
(svn r16801) -Fix [FS#3022]: cargo payments weren't destroyed when a vehicle was destructed. This only happened when you crashed a vehicle while it was unloading.
1 file changed with 2 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/vehicle.cpp
Show inline comments
 
@@ -494,12 +494,14 @@ void Vehicle::PreDestructor()
 
	if (CleaningPool()) return;
 

	
 
	if (Station::IsValidID(this->last_station_visited)) {
 
		Station::Get(this->last_station_visited)->loading_vehicles.remove(this);
 

	
 
		HideFillingPercent(&this->fill_percent_te_id);
 

	
 
		delete this->cargo_payment;
 
	}
 

	
 
	if (IsEngineCountable(this)) {
 
		Company::Get(this->owner)->num_engines[this->engine_type]--;
 
		if (this->owner == _local_company) InvalidateAutoreplaceWindow(this->engine_type, this->group_id);
 

	
0 comments (0 inline, 0 general)