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>
This commit is contained in:
PlayerBotPro 2024-04-11 23:58:50 +08:00 committed by GitHub
parent bcf1133477
commit 6165b46ab6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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);