File diff r12289:a05fa9e13224 → r12290:442d5d533a57
src/vehicle.cpp
Show inline comments
 
@@ -515,13 +515,13 @@ 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_TRAIN || (this->type == VEH_TRAIN && (IsFrontEngine(this) || IsFreeWagon(this)))) {
 
	if (this->type != VEH_TRAIN || (this->type == VEH_TRAIN && (Train::From(this)->IsFrontEngine() || IsFreeWagon(this)))) {
 
		InvalidateWindowData(WC_VEHICLE_DEPOT, this->tile);
 
	}
 

	
 
	if (this->IsPrimaryVehicle()) {
 
		DeleteWindowById(WC_VEHICLE_VIEW, this->index);
 
		DeleteWindowById(WC_VEHICLE_ORDERS, this->index);
 
@@ -956,24 +956,26 @@ uint8 CalcPercentVehicleFilled(const Veh
 
	return (count * 100) / max;
 
}
 

	
 
void VehicleEnterDepot(Vehicle *v)
 
{
 
	switch (v->type) {
 
		case VEH_TRAIN:
 
		case VEH_TRAIN: {
 
			Train *t = Train::From(v);
 
			InvalidateWindowClasses(WC_TRAINS_LIST);
 
			/* Clear path reservation */
 
			SetDepotWaypointReservation(v->tile, false);
 
			if (_settings_client.gui.show_track_reservation) MarkTileDirtyByTile(v->tile);
 
			SetDepotWaypointReservation(t->tile, false);
 
			if (_settings_client.gui.show_track_reservation) MarkTileDirtyByTile(t->tile);
 

	
 
			if (!IsFrontEngine(v)) v = v->First();
 
			UpdateSignalsOnSegment(v->tile, INVALID_DIAGDIR, v->owner);
 
			v->load_unload_time_rem = 0;
 
			ClrBit(Train::From(v)->flags, VRF_TOGGLE_REVERSE);
 
			TrainConsistChanged(Train::From(v), true);
 
			if (!t->IsFrontEngine()) t = t->First();
 
			UpdateSignalsOnSegment(t->tile, INVALID_DIAGDIR, t->owner);
 
			t->load_unload_time_rem = 0;
 
			ClrBit(t->flags, VRF_TOGGLE_REVERSE);
 
			TrainConsistChanged(t, true);
 
			break;
 
		}
 

	
 
		case VEH_ROAD:
 
			InvalidateWindowClasses(WC_ROADVEH_LIST);
 
			if (!IsRoadVehFront(v)) v = v->First();
 
			break;