Changeset - r14085:7ca8eb8aa6ca
[Not reviewed]
master
0 1 0
rubidium - 15 years ago 2009-12-27 09:05:00
rubidium@openttd.org
(svn r18642) -Fix [FS#3432]: when a company goes bankrupt and has vehicles on a drive through road stop that is not theirs, the 'filled' cache of the road stops would get corrupted
1 file changed with 10 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/vehicle.cpp
Show inline comments
 
@@ -43,12 +43,13 @@
 
#include "core/smallmap_type.hpp"
 
#include "depot_func.h"
 
#include "network/network.h"
 
#include "core/pool_func.hpp"
 
#include "economy_base.h"
 
#include "articulated_vehicles.h"
 
#include "roadstop_base.h"
 

	
 
#include "table/sprites.h"
 
#include "table/strings.h"
 

	
 
#define GEN_HASH(x, y) ((GB((y), 6, 6) << 6) + GB((x), 7, 6))
 

	
 
@@ -571,12 +572,21 @@ void Vehicle::PreDestructor()
 
		if (st != NULL) {
 
			const AirportFTA *layout = st->Airport()->layout;
 
			CLRBITS(st->airport_flags, layout[a->previous_pos].block | layout[a->pos].block);
 
		}
 
	}
 

	
 

	
 
	if (this->type == VEH_ROAD && this->IsPrimaryVehicle()) {
 
		RoadVehicle *v = RoadVehicle::From(this);
 
		if (!(v->vehstatus & VS_CRASHED) && IsInsideMM(v->state, RVSB_IN_DT_ROAD_STOP, RVSB_IN_DT_ROAD_STOP_END)) {
 
			/* Leave the drive through roadstop, when you have not already left it. */
 
			RoadStop::GetByTile(v->tile, GetRoadStopType(v->tile))->Leave(v);
 
		}
 
	}
 

	
 
	if (this->Previous() == NULL) {
 
		InvalidateWindowData(WC_VEHICLE_DEPOT, this->tile);
 
	}
 

	
 
	if (this->IsPrimaryVehicle()) {
 
		DeleteWindowById(WC_VEHICLE_VIEW, this->index);
0 comments (0 inline, 0 general)