From 2e8f93a821351fe47252be69e410096ff8f3e55c Mon Sep 17 00:00:00 2001 From: rubidium Date: Mon, 8 Oct 2007 20:06:37 +0000 Subject: (svn r11229) -Fix [FS#1307]: one could sell vehicles that were crashed in a depot, which would still yield money. --- src/train_cmd.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/train_cmd.cpp') diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp index 1b725e84a..4757db3d2 100644 --- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -1216,6 +1216,8 @@ CommandCost CmdSellRailWagon(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) if (v->type != VEH_TRAIN || !CheckOwnership(v->owner)) return CMD_ERROR; + if (HASBITS(v->vehstatus, VS_CRASHED)) return_cmd_error(STR_CAN_T_SELL_DESTROYED_VEHICLE); + SET_EXPENSES_TYPE(EXPENSES_NEW_VEHICLES); while (IsArticulatedPart(v)) v = v->Previous(); -- cgit v1.2.3-70-g09d2