Merge branch 'tracerestrict-sx' into jgrpp

# Conflicts:
#	src/command.cpp
#	src/group_gui.cpp
#	src/lang/english.txt
#	src/saveload/extended_ver_sl.cpp
#	src/settings_gui.cpp
#	src/tracerestrict.cpp
#	src/tracerestrict.h
#	src/tracerestrict_gui.cpp
#	src/vehicle_gui.cpp
#	src/vehicle_gui_base.h
#	src/vehiclelist.cpp
#	src/window_type.h
This commit is contained in:
Jonathan G Rennison
2017-04-05 19:00:24 +01:00
24 changed files with 1719 additions and 40 deletions

View File

@@ -51,6 +51,7 @@
#include "tunnel_map.h"
#include "depot_map.h"
#include "gamelog.h"
#include "tracerestrict.h"
#include "linkgraph/linkgraph.h"
#include "linkgraph/refresh.h"
#include "blitter/factory.hpp"
@@ -856,6 +857,11 @@ void Vehicle::PreDestructor()
if (this->owner == _local_company) InvalidateAutoreplaceWindow(this->engine_type, this->group_id);
DeleteGroupHighlightOfVehicle(this);
if (this->type == VEH_TRAIN) {
extern void DeleteTraceRestrictSlotHighlightOfVehicle(const Vehicle *v);
DeleteTraceRestrictSlotHighlightOfVehicle(this);
}
}
if (this->type == VEH_AIRCRAFT && this->IsPrimaryVehicle()) {
@@ -876,6 +882,11 @@ void Vehicle::PreDestructor()
}
}
if (this->type == VEH_TRAIN && HasBit(Train::From(this)->flags, VRF_HAVE_SLOT)) {
TraceRestrictRemoveVehicleFromAllSlots(this->index);
ClrBit(Train::From(this)->flags, VRF_HAVE_SLOT);
}
if (this->Previous() == NULL) {
InvalidateWindowData(WC_VEHICLE_DEPOT, this->tile);
}