From 48a1ddd401ab5c5973aba9611291f83fe04184bf Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sat, 16 Jan 2016 21:58:59 -0600 Subject: [PATCH 1/2] #3166 - Fix Vehicle inventory is not locked --- addons/vehiclelock/functions/fnc_onOpenInventory.sqf | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/addons/vehiclelock/functions/fnc_onOpenInventory.sqf b/addons/vehiclelock/functions/fnc_onOpenInventory.sqf index 5db2cbebe0..62be76e0fb 100644 --- a/addons/vehiclelock/functions/fnc_onOpenInventory.sqf +++ b/addons/vehiclelock/functions/fnc_onOpenInventory.sqf @@ -37,6 +37,12 @@ if (GVAR(LockVehicleInventory) && //if setting not enabled _handeled = true; //Just opens a dummy groundContainer (so the player can still see their own inventory) ACE_player action ["Gear", objNull]; + + //As of right now arma doesn't seem to be respecting this anymore, delaying a frame seems to work. + [{ + TRACE_1("delaying a frame", ace_player); + ACE_player action ["Gear", objNull]; + }, []] call EFUNC(common,execNextFrame); }; _handeled From 0ea1c0c03ff60656971bde286a1d48dd51c3cada Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Tue, 19 Jan 2016 08:31:52 -0600 Subject: [PATCH 2/2] Cleanup non-working code, and documentation --- addons/vehiclelock/functions/fnc_onOpenInventory.sqf | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/addons/vehiclelock/functions/fnc_onOpenInventory.sqf b/addons/vehiclelock/functions/fnc_onOpenInventory.sqf index 62be76e0fb..17682c72de 100644 --- a/addons/vehiclelock/functions/fnc_onOpenInventory.sqf +++ b/addons/vehiclelock/functions/fnc_onOpenInventory.sqf @@ -35,12 +35,11 @@ if (GVAR(LockVehicleInventory) && //if setting not enabled playSound "ACE_Sound_Click"; //don't open the vehicles inventory _handeled = true; - //Just opens a dummy groundContainer (so the player can still see their own inventory) - ACE_player action ["Gear", objNull]; - //As of right now arma doesn't seem to be respecting this anymore, delaying a frame seems to work. + // As of 1.54 the action needs to be delayed a frame to work, which used not to be the case [{ TRACE_1("delaying a frame", ace_player); + //Just opens a dummy groundContainer (so the player can still see their own inventory) ACE_player action ["Gear", objNull]; }, []] call EFUNC(common,execNextFrame); };