summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2005-01-23 11:37:27 +0000
committertruelight <truelight@openttd.org>2005-01-23 11:37:27 +0000
commit18f16908a2a6e274892bdd61f78e03687c128079 (patch)
tree782722f8fb801e8643303a309454029081020db3
parent61a3ac68e22c1d621646bbe4e13399491b689980 (diff)
downloadopenttd-18f16908a2a6e274892bdd61f78e03687c128079.tar.xz
(svn r1607) -Fix: When deleting an order, the next pointer was not cleared,
resulting in some unusual behavoir from time to time
-rw-r--r--order_cmd.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/order_cmd.c b/order_cmd.c
index 6c016ad76..f1d4cce2d 100644
--- a/order_cmd.c
+++ b/order_cmd.c
@@ -273,6 +273,7 @@ int32 CmdDeleteOrder(int x, int y, uint32 flags, uint32 vehicle_id, uint32 selec
/* Give the item free */
order->type = OT_NOTHING;
+ order->next = NULL;
u = GetFirstVehicleFromSharedList(v);
while (u != NULL) {
@@ -568,6 +569,7 @@ void BackupVehicleOrders(Vehicle *v, BackuppedOrders *bak)
}
/* End the list with an OT_NOTHING */
dest->type = OT_NOTHING;
+ dest->next = NULL;
}
}
@@ -663,7 +665,7 @@ bool CheckOrders(uint data_a, uint data_b)
} else {
DEBUG(misc, 3) ("CheckOrder called in mode 1 (validation mode) for %d", v->index);
}*/
-
+
FOR_VEHICLE_ORDERS(v, order) {
/* Dummy order? */
if (order->type == OT_DUMMY) {