Skip to content

Commit

Permalink
Medical Treatment - Fix Painkiller has no effect when Advanced Medica…
Browse files Browse the repository at this point in the history
…tion is off (#9942)

* fix: Painkiller has no effect when Advanced Medication is off

* Change PainKillers_PAIN_SUPPRESSION to uppercase

* Update addons/medical_treatment/functions/fnc_medicationLocal.sqf

Co-authored-by: johnb432 <[email protected]>

---------

Co-authored-by: Grim <[email protected]>
Co-authored-by: johnb432 <[email protected]>
  • Loading branch information
3 people authored Apr 11, 2024
1 parent bcf1133 commit 6165b46
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions addons/medical_treatment/functions/fnc_medicationLocal.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@

// todo: move this macro to script_macros_medical.hpp?
#define MORPHINE_PAIN_SUPPRESSION 0.6
// 0.2625 = 0.6/0.8 * 0.35
// 0.6 = basic medication morph. pain suppr., 0.8 = adv. medication morph. pain suppr., 0.35 = adv. medication painkillers. pain suppr.
#define PAINKILLERS_PAIN_SUPPRESSION 0.2625

params ["_patient", "_bodyPart", "_classname"];
TRACE_3("medicationLocal",_patient,_bodyPart,_classname);
Expand All @@ -36,6 +39,10 @@ if (!GVAR(advancedMedication)) exitWith {
case "Epinephrine": {
[QEGVAR(medical,WakeUp), _patient] call CBA_fnc_localEvent;
};
case "Painkillers": {
private _painSuppress = GET_PAIN_SUPPRESS(_patient);
_patient setVariable [VAR_PAIN_SUPP, (_painSuppress + PAINKILLERS_PAIN_SUPPRESSION) min 1, true];
};
};
};
TRACE_1("Running treatmentMedicationLocal with Advanced configuration for",_patient);
Expand Down

0 comments on commit 6165b46

Please sign in to comment.