From 8ac98ed950aca7b67311fe14b843db68122f8380 Mon Sep 17 00:00:00 2001 From: ViperMaul Date: Tue, 4 Aug 2015 07:43:42 -0700 Subject: [PATCH] Better immersion through using hideUnit --- addons/common/functions/fnc_headBugFix.sqf | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/addons/common/functions/fnc_headBugFix.sqf b/addons/common/functions/fnc_headBugFix.sqf index 0d2860f3b0..fe9354f632 100644 --- a/addons/common/functions/fnc_headBugFix.sqf +++ b/addons/common/functions/fnc_headBugFix.sqf @@ -12,8 +12,8 @@ private ["_pos","_dir","_anim"]; _anim = animationState ACE_player; -["HeadbugFixUsed", [profileName, (animationState ACE_player)]] call FUNC(serverEvent); -["HeadbugFixUsed", [profileName, (animationState ACE_player)]] call FUNC(localEvent); +["HeadbugFixUsed", [profileName, _anim]] call FUNC(serverEvent); +["HeadbugFixUsed", [profileName, _anim]] call FUNC(localEvent); if (ACE_player != vehicle ACE_player || { !([ACE_player, objNull, ["isNotSitting"]] call FUNC(canInteractWith)) } ) exitWith {false}; @@ -21,19 +21,22 @@ _pos = getposATL ACE_player; _dir = getDir ACE_player; titleCut ["", "BLACK"]; +[ACE_Player, "headBugFix"] call FUNC(hideUnit); // create invisible headbug fix vehicle -_ACE_HeadbugFix = createVehicle ["ACE_Headbug_Fix", [0,0,10000], [], 0, "NONE"]; +_ACE_HeadbugFix = "ACE_Headbug_Fix" createVehicleLocal _pos; _ACE_HeadbugFix setDir _dir; ACE_player moveInAny _ACE_HeadbugFix; -_ACE_HeadbugFix setposATL _pos; sleep 0.1; + unassignVehicle ACE_player; ACE_player action ["Eject", vehicle ACE_player]; ACE_player setDir _dir; ACE_player setposATL _pos; sleep 1.0; + deleteVehicle _ACE_HeadbugFix; +[ACE_Player, "headBugFix"] call FUNC(unhideUnit); titleCut ["", "PLAIN"]; true