diff src/roadveh_cmd.cpp @ 7695:3d5b53da1837 draft

(svn r11229) -Fix [FS#1307]: one could sell vehicles that were crashed in a depot, which would still yield money.
author rubidium <rubidium@openttd.org>
date Mon, 08 Oct 2007 20:06:37 +0000
parents af0275bc24b4
children 529cd49be451
line wrap: on
line diff
--- a/src/roadveh_cmd.cpp
+++ b/src/roadveh_cmd.cpp
@@ -359,6 +359,8 @@
 
 	if (v->type != VEH_ROAD || !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);
 
 	if (!CheckRoadVehInDepotStopped(v)) {