summaryrefslogtreecommitdiff
path: root/src/vehicle.cpp
diff options
context:
space:
mode:
authorbjarni <bjarni@openttd.org>2007-01-21 00:13:39 +0000
committerbjarni <bjarni@openttd.org>2007-01-21 00:13:39 +0000
commit24a8b1619780a95ce8e28b2ce6e3789bbc0f4742 (patch)
tree0d76459c94065804ab7100442d97b4ef070361a0 /src/vehicle.cpp
parent44494a8e93b9f28e8b609ac78d802c843a6329a6 (diff)
downloadopenttd-24a8b1619780a95ce8e28b2ce6e3789bbc0f4742.tar.xz
(svn r8294) -Fix: deleting a vehicle with shared orders, but no orders would fail to reset prev_shared and next_shared
-As a result, vehicles in the game could end up having prev/next pointers to vehicles, that was no longer in the game
Diffstat (limited to 'src/vehicle.cpp')
-rw-r--r--src/vehicle.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/vehicle.cpp b/src/vehicle.cpp
index 2ebd1e2b2..e3cd3b08d 100644
--- a/src/vehicle.cpp
+++ b/src/vehicle.cpp
@@ -572,7 +572,7 @@ void DestroyVehicle(Vehicle *v)
UpdateVehiclePosHash(v, INVALID_COORD, 0);
v->next_hash = NULL;
- if (v->orders != NULL) DeleteVehicleOrders(v);
+ if (IsPlayerBuildableVehicleType(v)) DeleteVehicleOrders(v);
/* Now remove any artic part. This will trigger an other
* destroy vehicle, which on his turn can remove any