Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent treatment animation on dead bodies #6524

Merged
merged 3 commits into from
Aug 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -191,7 +188,6 @@ class GVAR(Actions) {
callbackSuccess = QFUNC(actionDiagnose);
callbackFailure = "";
callbackProgress = "";
animationPatient = "";
animationCaller = ""; // TODO
itemConsumed = 0;
litter[] = {};
Expand Down Expand Up @@ -233,8 +229,6 @@ class GVAR(Actions) {
callbackSuccess = QFUNC(actionPlaceInBodyBag);
callbackFailure = "";
callbackProgress = "";
animationPatient = "";
animationPatientUnconscious = "";
itemConsumed = 1;
litter[] = {};
};
Expand All @@ -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 = "";
Expand Down Expand Up @@ -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 = "";
Expand Down
5 changes: 0 additions & 5 deletions addons/medical_treatment/ACE_Settings.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,4 @@ class ACE_Settings {
value = 0;
values[] = {"No", "Yes"};
};
class EGVAR(medical,allowUnconsciousAnimationOnTreatment) {
displayName = CSTRING(allowUnconsciousAnimationOnTreatment_DisplayName);
typeName = "BOOL";
value = 0;
};
};
28 changes: 4 additions & 24 deletions addons/medical_treatment/functions/fnc_treatment.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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];
Expand Down
6 changes: 0 additions & 6 deletions addons/medical_treatment/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,6 @@
<Key ID="STR_ACE_Medical_treatment_allowSelfIV_Description">
<English>Allows using IV Transfusions on yourself</English>
</Key>
<Key ID="STR_ACE_Medical_treatment_allowUnconsciousAnimationOnTreatment_DisplayName">
<English>Allow Unconscious Animation</English>
</Key>
<Key ID="STR_ACE_Medical_treatment_allowUnconsciousAnimationOnTreatment_Description">
<English>Allow Unconscious Animation on Treatment.</English>
</Key>
<Key ID="STR_ACE_Medical_treatment_CPRcreatesPulse">
<English>CPR creates pulse</English>
<German>HLW erzeugt einen Puls</German>
Expand Down