summaryrefslogtreecommitdiff
path: root/src/aircraft_cmd.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-10-08 20:06:37 +0000
committerrubidium <rubidium@openttd.org>2007-10-08 20:06:37 +0000
commit2e8f93a821351fe47252be69e410096ff8f3e55c (patch)
tree558ec5c75aee553211edcce8233c8d5af44e12e8 /src/aircraft_cmd.cpp
parent91ac1310140ff093a7d7e310c8ce75baf71df35d (diff)
downloadopenttd-2e8f93a821351fe47252be69e410096ff8f3e55c.tar.xz
(svn r11229) -Fix [FS#1307]: one could sell vehicles that were crashed in a depot, which would still yield money.
Diffstat (limited to 'src/aircraft_cmd.cpp')
-rw-r--r--src/aircraft_cmd.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/aircraft_cmd.cpp b/src/aircraft_cmd.cpp
index b8bbf8d07..8dad10575 100644
--- a/src/aircraft_cmd.cpp
+++ b/src/aircraft_cmd.cpp
@@ -487,6 +487,8 @@ CommandCost CmdSellAircraft(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
if (v->type != VEH_AIRCRAFT || !CheckOwnership(v->owner)) return CMD_ERROR;
if (!v->IsStoppedInDepot()) return_cmd_error(STR_A01B_AIRCRAFT_MUST_BE_STOPPED);
+ if (HASBITS(v->vehstatus, VS_CRASHED)) return_cmd_error(STR_CAN_T_SELL_DESTROYED_VEHICLE);
+
SET_EXPENSES_TYPE(EXPENSES_NEW_VEHICLES);
if (flags & DC_EXEC) {