From 876a039e369e049ae10ec7cb94eaf248504224a1 Mon Sep 17 00:00:00 2001 From: ViperMaul Date: Sat, 1 Aug 2015 18:01:35 -0700 Subject: [PATCH 1/3] Disable headbugfix for Handcuffed/Surrender,unconscious,water surface and log the situation locally and on server. --- addons/common/XEH_postInit.sqf | 7 ++++++ addons/common/functions/fnc_headBugFix.sqf | 29 ++++++++++++++-------- 2 files changed, 25 insertions(+), 11 deletions(-) diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index 8b8b3a90055..832f2d695c8 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -37,6 +37,13 @@ }; }] call FUNC(addEventhandler); + +["HeadbugFixUsed", { + PARAMS_2(_profileName,_animation); + diag_log text format ["[ACE] Headbug Used: Name: %1, Animation: %2", _profileName, _animation]; +}] call FUNC(addEventHandler); + + //~~~~~Get Map Data~~~~~ //Find MGRS zone and 100km grid for current map [] call FUNC(getMGRSdata); diff --git a/addons/common/functions/fnc_headBugFix.sqf b/addons/common/functions/fnc_headBugFix.sqf index 272f64a0447..1126cd0b126 100644 --- a/addons/common/functions/fnc_headBugFix.sqf +++ b/addons/common/functions/fnc_headBugFix.sqf @@ -10,21 +10,28 @@ #include "script_component.hpp" private ["_pos","_dir","_anim"]; -if (player != vehicle player || {(player getvariable ["ace_isUnconscious", false])}) exitWith {}; + +_anim = animationState ACE_player; +["HeadbugFixUsed", [profileName, (animationState ACE_player)]] call FUNC(serverEvent); +["HeadbugFixUsed", [profileName, (animationState ACE_player)]] call FUNC(localEvent); + +if (ACE_player != vehicle ACE_player || { !([ACE_player, objNull, ["isNotSitting"]] call FUNC(canInteractWith)) } ) exitWith {false}; + +_pos = getposATL ACE_player; +_dir = getDir ACE_player; + titleCut ["", "BLACK"]; -_pos = getposATL player; -_dir = getDir player; -_anim = animationState player; + // create invisible headbug fix vehicle -_ACE_HeadbugFix = createVehicle ["ACE_Headbug_Fix", getposATL player, [], 0, "NONE"]; +_ACE_HeadbugFix = createVehicle ["ACE_Headbug_Fix", getposATL ACE_player, [], 0, "NONE"]; _ACE_HeadbugFix setDir _dir; -player moveInAny _ACE_HeadbugFix; +ACE_player moveInAny _ACE_HeadbugFix; sleep 1.0; -unassignVehicle player; -player action ["Eject", vehicle player]; +unassignVehicle ACE_player; +ACE_player action ["Eject", vehicle ACE_player]; sleep 1.0; deleteVehicle _ACE_HeadbugFix; -player setposATL _pos; -player setDir _dir; +ACE_player setposATL _pos; +ACE_player setDir _dir; titleCut ["", "PLAIN"]; - +true From 59a3e62d69117f09f2ffb8b71f5bfb4d62391ed3 Mon Sep 17 00:00:00 2001 From: ViperMaul Date: Sun, 2 Aug 2015 10:44:49 -0700 Subject: [PATCH 2/3] Attempt to improve the immersion of the magic --- addons/common/functions/fnc_headBugFix.sqf | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/addons/common/functions/fnc_headBugFix.sqf b/addons/common/functions/fnc_headBugFix.sqf index 1126cd0b126..0d2860f3b00 100644 --- a/addons/common/functions/fnc_headBugFix.sqf +++ b/addons/common/functions/fnc_headBugFix.sqf @@ -23,15 +23,17 @@ _dir = getDir ACE_player; titleCut ["", "BLACK"]; // create invisible headbug fix vehicle -_ACE_HeadbugFix = createVehicle ["ACE_Headbug_Fix", getposATL ACE_player, [], 0, "NONE"]; +_ACE_HeadbugFix = createVehicle ["ACE_Headbug_Fix", [0,0,10000], [], 0, "NONE"]; _ACE_HeadbugFix setDir _dir; ACE_player moveInAny _ACE_HeadbugFix; -sleep 1.0; +_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 setposATL _pos; -ACE_player setDir _dir; + titleCut ["", "PLAIN"]; true From 8ac98ed950aca7b67311fe14b843db68122f8380 Mon Sep 17 00:00:00 2001 From: ViperMaul Date: Tue, 4 Aug 2015 07:43:42 -0700 Subject: [PATCH 3/3] 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 0d2860f3b00..fe9354f6329 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