From 825ad3bd477e46ea6ae1ea33e1e590b04e2d0b1f Mon Sep 17 00:00:00 2001 From: Blue Date: Tue, 4 Jul 2023 13:45:04 +0200 Subject: [PATCH] Misc - Fix shared vehicle equipment "except self-treatment" setting (#361) **When merged this pull request will:** - Fix shared vehicle equipment "except self-treatment" setting not allowing self-treatment in vehicle ### IMPORTANT - [Development Guidelines](https://ace3.acemod.org/wiki/development/) are read, understood and applied. - Title of this PR uses our standard template `Component - Add|Fix|Improve|Change|Make|Remove {changes}`. --- addons/misc/functions/fnc_removeItemFromVehicle.sqf | 4 ++-- addons/misc/functions/fnc_useItem.sqf | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/addons/misc/functions/fnc_removeItemFromVehicle.sqf b/addons/misc/functions/fnc_removeItemFromVehicle.sqf index 4a5deae51..6359f1daf 100644 --- a/addons/misc/functions/fnc_removeItemFromVehicle.sqf +++ b/addons/misc/functions/fnc_removeItemFromVehicle.sqf @@ -12,12 +12,12 @@ * None * * Example: - * [player,"ACE_elasticBandage"] call kat_misc_fnc_removeItemFromVehicle + * [vehicle player, "kat_Painkiller", true] call kat_misc_fnc_removeItemFromVehicle * * Public: No */ -params ["_vehicle","_item",["_isMagazine",false]]; +params ["_vehicle", "_item", ["_isMagazine", false]]; if !(_isMagazine) then { private _cargoItems = getItemCargo _vehicle; diff --git a/addons/misc/functions/fnc_useItem.sqf b/addons/misc/functions/fnc_useItem.sqf index 57f51bba0..dea549d31 100644 --- a/addons/misc/functions/fnc_useItem.sqf +++ b/addons/misc/functions/fnc_useItem.sqf @@ -44,7 +44,8 @@ if (GVAR(allowSharedVehicleEquipment) > 0 && _vehicleCondition) then { }; case 3: { // Vehicle's equipment first (except self-treatment) if(_medic isEqualTo _patient) then { - _useOrder = _sharedUseOrder + _vehicle; + _useOrder = _sharedUseOrder + [_vehicle]; + _vehicleIndex = (count _useOrder) - 1; } else { _useOrder = ([_vehicle] + _sharedUseOrder); _vehicleIndex = 0;