summaryrefslogtreecommitdiff
path: root/ship_cmd.c
diff options
context:
space:
mode:
authormatthijs <matthijs@openttd.org>2005-05-03 19:31:33 +0000
committermatthijs <matthijs@openttd.org>2005-05-03 19:31:33 +0000
commit24943a4759d290b2b01cc5d2607f6317b7ccfcb9 (patch)
tree717aa7afe0491338a1a0f2486f2f9242d228fb3f /ship_cmd.c
parent9b8aa4c10114f851815b703083ff9dc2d27f3675 (diff)
downloadopenttd-24943a4759d290b2b01cc5d2607f6317b7ccfcb9.tar.xz
(svn r2261) - Fix: When crashed vehicles try to find a depot for servicing, openttd asserts.
Crashed vehicles shouldn't find depots anyway...
Diffstat (limited to 'ship_cmd.c')
-rw-r--r--ship_cmd.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ship_cmd.c b/ship_cmd.c
index 75ef25736..90810ad96 100644
--- a/ship_cmd.c
+++ b/ship_cmd.c
@@ -1002,6 +1002,9 @@ int32 CmdSendShipToDepot(int x, int y, uint32 flags, uint32 p1, uint32 p2)
if (v->type != VEH_Ship || !CheckOwnership(v->owner))
return CMD_ERROR;
+ if (v->vehstatus & VS_CRASHED)
+ return CMD_ERROR;
+
if (v->current_order.type == OT_GOTO_DEPOT) {
if (flags & DC_EXEC) {