From 6165b46ab6ec8657ba5f30060f310bb72d1a0679 Mon Sep 17 00:00:00 2001 From: PlayerBotPro Date: Thu, 11 Apr 2024 23:58:50 +0800 Subject: [PATCH] Medical Treatment - Fix Painkiller has no effect when Advanced Medication 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 <58661205+johnb432@users.noreply.github.com> --------- Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> --- addons/medical_treatment/functions/fnc_medicationLocal.sqf | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/addons/medical_treatment/functions/fnc_medicationLocal.sqf b/addons/medical_treatment/functions/fnc_medicationLocal.sqf index 31884dac209..0b23b365e84 100644 --- a/addons/medical_treatment/functions/fnc_medicationLocal.sqf +++ b/addons/medical_treatment/functions/fnc_medicationLocal.sqf @@ -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); @@ -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);