src/train_cmd.cpp
changeset 8191 3ffc17ef4ff5
parent 8138 7dc73953c47e
child 8192 dcc489afe013
equal deleted inserted replaced
8190:efd1f3b110a2 8191:3ffc17ef4ff5
  1214 
  1214 
  1215 	Vehicle *v = GetVehicle(p1);
  1215 	Vehicle *v = GetVehicle(p1);
  1216 
  1216 
  1217 	if (v->type != VEH_TRAIN || !CheckOwnership(v->owner)) return CMD_ERROR;
  1217 	if (v->type != VEH_TRAIN || !CheckOwnership(v->owner)) return CMD_ERROR;
  1218 
  1218 
       
  1219 	if (HASBITS(v->vehstatus, VS_CRASHED)) return_cmd_error(STR_CAN_T_SELL_DESTROYED_VEHICLE);
       
  1220 
  1219 	SET_EXPENSES_TYPE(EXPENSES_NEW_VEHICLES);
  1221 	SET_EXPENSES_TYPE(EXPENSES_NEW_VEHICLES);
  1220 
  1222 
  1221 	while (IsArticulatedPart(v)) v = v->Previous();
  1223 	while (IsArticulatedPart(v)) v = v->Previous();
  1222 	Vehicle *first = v->First();
  1224 	Vehicle *first = v->First();
  1223 
  1225