summaryrefslogtreecommitdiff
path: root/vehicle.c
diff options
context:
space:
mode:
authorbjarni <bjarni@openttd.org>2005-11-04 22:10:49 +0000
committerbjarni <bjarni@openttd.org>2005-11-04 22:10:49 +0000
commit7d4d13df3519d6db4b324b132c32325d25f7f5c3 (patch)
tree9d59ce235d00d5ade8a312f2ccc432deab760a16 /vehicle.c
parentc8ea743e4779facc0f1c2b8edfdfc98307e31dc9 (diff)
downloadopenttd-7d4d13df3519d6db4b324b132c32325d25f7f5c3.tar.xz
(svn r3137) -Fix: [autoreplace] fixed assert that was triggerable when a vehicle entered a depot even though the goto depot was canceled
this assert could be reached by clicking on the goto depot button to cancel goto depot from the orders and the vehicle still entered the depot. The flags in that case would not be "normal" anymore. An additional check is added to prevent this
Diffstat (limited to 'vehicle.c')
-rw-r--r--vehicle.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/vehicle.c b/vehicle.c
index ae21c5b19..b88811bdf 100644
--- a/vehicle.c
+++ b/vehicle.c
@@ -527,7 +527,7 @@ Vehicle *_first_veh_in_depot_list;
void VehicleEnteredDepotThisTick(Vehicle *v)
{
// we need to set v->leave_depot_instantly as we have no control of it's contents at this time
- if (HASBIT(v->current_order.flags, OFB_HALT_IN_DEPOT) && !HASBIT(v->current_order.flags, OFB_PART_OF_ORDERS)) {
+ if (HASBIT(v->current_order.flags, OFB_HALT_IN_DEPOT) && !HASBIT(v->current_order.flags, OFB_PART_OF_ORDERS) && v->current_order.type == OT_GOTO_DEPOT) {
// we keep the vehicle in the depot since the user ordered it to stay
v->leave_depot_instantly = false;
} else {