From 0e8ed5315eb8de0a6a9be2c93cb2c240db0385ac Mon Sep 17 00:00:00 2001 From: SilentSpike Date: Sun, 12 Aug 2018 12:28:48 +0100 Subject: [PATCH] Remove patient treatment animations (#6524) * Prevent treatment animation on dead bodies This was causing bodies to glitch out on dedicated servers according to feedback * Remove patient animation logic and setting --- .../ACE_Medical_Treatment_Actions.hpp | 10 ------- addons/medical_treatment/ACE_Settings.hpp | 5 ---- .../functions/fnc_treatment.sqf | 28 +++---------------- addons/medical_treatment/stringtable.xml | 6 ---- 4 files changed, 4 insertions(+), 45 deletions(-) diff --git a/addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp b/addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp index f244ee0ce19..8141443367e 100644 --- a/addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp +++ b/addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp @@ -18,9 +18,6 @@ class GVAR(Actions) { callbackFailure = ""; callbackProgress = ""; - animationPatient = ""; - animationPatientUnconscious = "AinjPpneMstpSnonWrflDnon_rolltoback"; - animationPatientUnconsciousExcludeOn[] = {"ainjppnemstpsnonwrfldnon"}; animationCaller = "AinvPknlMstpSlayW[wpn]Dnon_medicOther"; animationCallerProne = "AinvPpneMstpSlayW[wpn]Dnon_medicOther"; animationCallerSelf = "AinvPknlMstpSlayW[wpn]Dnon_medic"; @@ -191,7 +188,6 @@ class GVAR(Actions) { callbackSuccess = QFUNC(actionDiagnose); callbackFailure = ""; callbackProgress = ""; - animationPatient = ""; animationCaller = ""; // TODO itemConsumed = 0; litter[] = {}; @@ -233,8 +229,6 @@ class GVAR(Actions) { callbackSuccess = QFUNC(actionPlaceInBodyBag); callbackFailure = ""; callbackProgress = ""; - animationPatient = ""; - animationPatientUnconscious = ""; itemConsumed = 1; litter[] = {}; }; @@ -253,8 +247,6 @@ class GVAR(Actions) { callbackFailure = QFUNC(treatmentCPR_failure); callbackProgress = QFUNC(treatmentCPR_progress); callbackStart = QFUNC(treatmentCPR_start); - animationPatient = ""; - animationPatientUnconscious = "AinjPpneMstpSnonWrflDnon_rolltoback"; animationCaller = "AinvPknlMstpSlayW[wpn]Dnon_medic"; animationCallerProne = "AinvPpneMstpSlayW[wpn]Dnon_medic"; animationCallerSelf = ""; @@ -289,8 +281,6 @@ class GVAR(Actions) { treatmentTime = QUOTE(_target call FUNC(healTime)); callbackSuccess = QFUNC(treatmentFullHeal); itemConsumed = QEGVAR(medical,consumeItem_PAK); - animationPatient = ""; - animationPatientUnconscious = "AinjPpneMstpSnonWrflDnon_rolltoback"; animationCaller = "AinvPknlMstpSlayW[wpn]Dnon_medicOther"; animationCallerProne = "AinvPpneMstpSlayW[wpn]Dnon_medicOther"; animationCallerSelf = ""; diff --git a/addons/medical_treatment/ACE_Settings.hpp b/addons/medical_treatment/ACE_Settings.hpp index 260308770f8..55d8eacac41 100644 --- a/addons/medical_treatment/ACE_Settings.hpp +++ b/addons/medical_treatment/ACE_Settings.hpp @@ -135,9 +135,4 @@ class ACE_Settings { value = 0; values[] = {"No", "Yes"}; }; - class EGVAR(medical,allowUnconsciousAnimationOnTreatment) { - displayName = CSTRING(allowUnconsciousAnimationOnTreatment_DisplayName); - typeName = "BOOL"; - value = 0; - }; }; diff --git a/addons/medical_treatment/functions/fnc_treatment.sqf b/addons/medical_treatment/functions/fnc_treatment.sqf index e91463dd404..b76e6799eef 100644 --- a/addons/medical_treatment/functions/fnc_treatment.sqf +++ b/addons/medical_treatment/functions/fnc_treatment.sqf @@ -25,6 +25,7 @@ if (uiNamespace getVariable [QEGVAR(interact_menu,cursorMenuOpened), false]) exi if !([_caller, _target, _bodyPart, _className] call FUNC(canTreat)) exitWith {false}; private _config = configFile >> QGVAR(Actions) >> _className; +private _isSelf = _caller isEqualTo _target; // handle items private _items = getArray (_config >> "items"); @@ -58,32 +59,11 @@ if (isNil _callbackProgress) then { _callbackProgress = missionNamespace getVariable _callbackProgress; }; -// play patient animation -private _patientAnim = getText (_config >> "animationPatient"); - -if (IS_UNCONSCIOUS(_target) && EGVAR(medical,allowUnconsciousAnimationOnTreatment)) then { - if !(animationState _target in (getArray (_config >> "animationPatientUnconsciousExcludeOn"))) then { - _patientAnim = getText (_config >> "animationPatientUnconscious"); - }; -}; - -private _isSelf = _caller isEqualTo _target; - -if (!_isSelf && {vehicle _target == _target} && {_patientAnim != ""}) then { - if IS_UNCONSCIOUS(_target) then { - [_target, _patientAnim, 2, true] call EFUNC(common,doAnimation); - } else { - [_target, _patientAnim, 1, true] call EFUNC(common,doAnimation); - }; -}; - // play animation -private "_callerAnim"; - -if (_isSelf) then { - _callerAnim = getText (_config >> ["animationCallerSelf", "animationCallerSelfProne"] select (stance _caller == "PRONE")); +private _callerAnim = if (_isSelf) then { + getText (_config >> ["animationCallerSelf", "animationCallerSelfProne"] select (stance _caller == "PRONE")); } else { - _callerAnim = getText (_config >> ["animationCaller", "animationCallerProne"] select (stance _caller == "PRONE")); + getText (_config >> ["animationCaller", "animationCallerProne"] select (stance _caller == "PRONE")); }; _caller setVariable [QGVAR(selectedWeaponOnTreatment), weaponState _caller]; diff --git a/addons/medical_treatment/stringtable.xml b/addons/medical_treatment/stringtable.xml index 17f8aa5129f..abd9063a05f 100644 --- a/addons/medical_treatment/stringtable.xml +++ b/addons/medical_treatment/stringtable.xml @@ -56,12 +56,6 @@ Allows using IV Transfusions on yourself - - Allow Unconscious Animation - - - Allow Unconscious Animation on Treatment. - CPR creates pulse HLW erzeugt einen Puls