From 260b048da4e179923b537a9445e0b9ac36753a90 Mon Sep 17 00:00:00 2001 From: jokoho48 Date: Sun, 23 Aug 2015 14:13:55 +0200 Subject: [PATCH] some more Improvements --- addons/medical/functions/fnc_actionCheckResponse.sqf | 6 +----- addons/medical/functions/fnc_setHitPointDamage.sqf | 4 ++-- addons/medical/functions/fnc_treatment_failure.sqf | 12 ++++++------ addons/medical/functions/fnc_treatment_success.sqf | 12 ++++++------ 4 files changed, 15 insertions(+), 19 deletions(-) diff --git a/addons/medical/functions/fnc_actionCheckResponse.sqf b/addons/medical/functions/fnc_actionCheckResponse.sqf index 7db4fe0a5d..6910545a9d 100644 --- a/addons/medical/functions/fnc_actionCheckResponse.sqf +++ b/addons/medical/functions/fnc_actionCheckResponse.sqf @@ -17,11 +17,7 @@ private ["_output"]; params ["_caller", "_target"]; -_output = if ([_target] call EFUNC(common,isAwake)) then { - LSTRING(Check_Response_Responsive) -} else { - LSTRING(Check_Response_Unresponsive) -}; +_output = [LSTRING(Check_Response_Unresponsive), LSTRING(Check_Response_Responsive)] select ([_target] call EFUNC(common,isAwake)); ["displayTextStructured", [_caller], [[_output, [_target] call EFUNC(common,getName)], 2, _caller]] call EFUNC(common,targetEvent); diff --git a/addons/medical/functions/fnc_setHitPointDamage.sqf b/addons/medical/functions/fnc_setHitPointDamage.sqf index 1713c02243..f8698a7fe0 100644 --- a/addons/medical/functions/fnc_setHitPointDamage.sqf +++ b/addons/medical/functions/fnc_setHitPointDamage.sqf @@ -22,7 +22,7 @@ #define ARMDAMAGETRESHOLD2 1.7 private ["_unit", "_selection", "_damage", "_selections", "_damages", "_damageOld", "_damageSumOld", "_damageNew", "_damageSumNew", "_damageFinal", "_armdamage", "_legdamage"]; -params ["_unit", "_selection", "_damage", ["_disalbed", false]]; +params ["_unit", "_selection", "_damage", ["_disabled", false]]; // Unit isn't local, give function to machine where it is. if !(local _unit) exitWith { @@ -30,7 +30,7 @@ if !(local _unit) exitWith { }; // Check if overall damage adjustment is disabled -if (_disalbed) exitWith { +if (_disabled) exitWith { _unit setHitPointDamage [_selection, _damage]; }; diff --git a/addons/medical/functions/fnc_treatment_failure.sqf b/addons/medical/functions/fnc_treatment_failure.sqf index 483a8923eb..84526daa88 100644 --- a/addons/medical/functions/fnc_treatment_failure.sqf +++ b/addons/medical/functions/fnc_treatment_failure.sqf @@ -28,12 +28,12 @@ if (vehicle _caller == _caller) then { _lastAnim = _caller getvariable [QGVAR(treatmentPrevAnimCaller), ""]; //Don't play another medic animation (when player is rapidily treating) TRACE_2("Reseting to old animation", animationState player, _lastAnim); - switch _lastAnim do { - case "AinvPknlMstpSlayWrflDnon_medic": {_lastAnim = "AmovPknlMstpSrasWrflDnon"}; - case "AinvPpneMstpSlayWrflDnon_medic": {_lastAnim = "AmovPpneMstpSrasWrflDnon"}; - case "AinvPknlMstpSlayWnonDnon_medic": {_lastAnim = "AmovPknlMstpSnonWnonDnon"}; - case "AinvPpneMstpSlayWpstDnon_medic": {_lastAnim = "AinvPpneMstpSlayWpstDnon"}; - case "AinvPknlMstpSlayWpstDnon_medic": {_lastAnim = "AmovPknlMstpSrasWpstDnon"}; + switch (toLower _lastAnim) do { + case "ainvpknlmstpslaywrfldnon_medic": {_lastAnim = "AmovPknlMstpSrasWrflDnon"}; + case "ainvppnemstpslaywrfldnon_medic": {_lastAnim = "AmovPpneMstpSrasWrflDnon"}; + case "ainvpknlmstpslaywnondnon_medic": {_lastAnim = "AmovPknlMstpSnonWnonDnon"}; + case "ainvppnemstpslaywpstdnon_medic": {_lastAnim = "AinvPpneMstpSlayWpstDnon"}; + case "ainvpknlmstpslaywpstdnon_medic": {_lastAnim = "AmovPknlMstpSrasWpstDnon"}; }; [_caller, _lastAnim, 1] call EFUNC(common,doAnimation); [_caller, _lastAnim, 1] call EFUNC(common,doAnimation); diff --git a/addons/medical/functions/fnc_treatment_success.sqf b/addons/medical/functions/fnc_treatment_success.sqf index 0ba34d5a85..f21f027ee7 100644 --- a/addons/medical/functions/fnc_treatment_success.sqf +++ b/addons/medical/functions/fnc_treatment_success.sqf @@ -28,12 +28,12 @@ if (vehicle _caller == _caller) then { _lastAnim = _caller getvariable [QGVAR(treatmentPrevAnimCaller), ""]; //Don't play another medic animation (when player is rapidily treating) TRACE_2("Reseting to old animation", animationState player, _lastAnim); - switch _lastAnim do { - case "AinvPknlMstpSlayWrflDnon_medic": {_lastAnim = "AmovPknlMstpSrasWrflDnon"}; - case "AinvPpneMstpSlayWrflDnon_medic": {_lastAnim = "AmovPpneMstpSrasWrflDnon"}; - case "AinvPknlMstpSlayWnonDnon_medic": {_lastAnim = "AmovPknlMstpSnonWnonDnon"}; - case "AinvPpneMstpSlayWpstDnon_medic": {_lastAnim = "AinvPpneMstpSlayWpstDnon"}; - case "AinvPknlMstpSlayWpstDnon_medic": {_lastAnim = "AmovPknlMstpSrasWpstDnon"}; + switch (tolower _lastAnim) do { + case "ainvpknlmstpslaywrfldnon_medic": {_lastAnim = "AmovPknlMstpSrasWrflDnon"}; + case "ainvppnemstpslaywrfldnon_medic": {_lastAnim = "AmovPpneMstpSrasWrflDnon"}; + case "ainvpknlmstpslaywnondnon_medic": {_lastAnim = "AmovPknlMstpSnonWnonDnon"}; + case "ainvppnemstpslaywpstdnon_medic": {_lastAnim = "AinvPpneMstpSlayWpstDnon"}; + case "ainvpknlmstpslaywpstdnon_medic": {_lastAnim = "AmovPknlMstpSrasWpstDnon"}; }; [_caller, _lastAnim, 1] call EFUNC(common,doAnimation); };