Maintain map of targeted road vehicles to small UFO disaster vehicle
This commit is contained in:
@@ -1030,6 +1030,7 @@ void InitializeVehicles()
|
||||
{
|
||||
_vehicles_to_autoreplace.clear();
|
||||
ResetVehicleHash();
|
||||
ResetDisasterVehicleTargeting();
|
||||
}
|
||||
|
||||
uint CountVehiclesInChain(const Vehicle *v)
|
||||
@@ -1202,6 +1203,8 @@ void Vehicle::PreDestructor()
|
||||
/* Leave the drive through roadstop, when you have not already left it. */
|
||||
RoadStop::GetByTile(v->tile, GetRoadStopType(v->tile))->Leave(v);
|
||||
}
|
||||
|
||||
ReleaseDisasterVehicleTargetingVehicle(this->index);
|
||||
}
|
||||
|
||||
if (HasBit(this->vehicle_flags, VF_HAVE_SLOT)) {
|
||||
@@ -1238,8 +1241,6 @@ void Vehicle::PreDestructor()
|
||||
|
||||
StopGlobalFollowVehicle(this);
|
||||
|
||||
ReleaseDisastersTargetingVehicle(this->index);
|
||||
|
||||
/* sometimes, eg. for disaster vehicles, when company bankrupts, when removing crashed/flooded vehicles,
|
||||
* it may happen that vehicle chain is deleted when visible */
|
||||
if (this->IsDrawn()) this->MarkAllViewportsDirty();
|
||||
|
Reference in New Issue
Block a user