From 6b6cca55cb8f5611f17845868012a8b57286cec2 Mon Sep 17 00:00:00 2001 From: Blue Date: Thu, 26 Oct 2023 15:34:02 +0200 Subject: [PATCH] onMedicationUsage go away --- addons/pharma/CfgFunctions.hpp | 3 - addons/pharma/XEH_PREP.hpp | 1 - .../functions/fnc_onMedicationUsage.sqf | 62 ------------------- 3 files changed, 66 deletions(-) delete mode 100644 addons/pharma/functions/fnc_onMedicationUsage.sqf diff --git a/addons/pharma/CfgFunctions.hpp b/addons/pharma/CfgFunctions.hpp index 2e0004512..348a5731e 100644 --- a/addons/pharma/CfgFunctions.hpp +++ b/addons/pharma/CfgFunctions.hpp @@ -17,9 +17,6 @@ class CfgFunctions { class medicationLocal { file = QPATHTOF(functions\fnc_medicationLocal.sqf); }; - class onMedicationUsage { - file = QPATHTOF(functions\fnc_onMedicationUsage.sqf); - }; class tourniquetRemove { file = QPATHTOF(functions\fnc_tourniquetRemove.sqf); }; diff --git a/addons/pharma/XEH_PREP.hpp b/addons/pharma/XEH_PREP.hpp index 0d6432842..972afa228 100644 --- a/addons/pharma/XEH_PREP.hpp +++ b/addons/pharma/XEH_PREP.hpp @@ -9,7 +9,6 @@ PREP(init); PREP(inspectCatheter); PREP(medication); PREP(medicationLocal); -PREP(onMedicationUsage); PREP(pervitinPP); PREP(removeItemfromMag); PREP(removeIV); diff --git a/addons/pharma/functions/fnc_onMedicationUsage.sqf b/addons/pharma/functions/fnc_onMedicationUsage.sqf deleted file mode 100644 index 379c4bd6b..000000000 --- a/addons/pharma/functions/fnc_onMedicationUsage.sqf +++ /dev/null @@ -1,62 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: Glowbal - * Handles the medication given to a patient. - * - * Arguments: - * 0: The patient - * 1: Medication Treatment classname - * 2: Max dosage (0 to ignore) - * 3: Incompatable medication > - * - * Return Value: - * None - * - * Example: - * [player, "morphine", 4, [["x", 1]]] call ace_medical_treatment_fnc_onMedicationUsage - * - * Public: No - */ - -params ["_target", "_className", "_maxDosage", "_incompatibleMedication"]; -TRACE_4("onMedicationUsage",_target,_className,_maxDosage,_incompatibleMedication); - -private _overdosedMedications = []; - -// Check for overdose from current medication -if (_maxDosage > 0) then { - private _currentDose = [_target, _className] call ACEFUNC(medical_status,getMedicationCount); - if (_currentDose >= floor (_maxDosage + floor(random(1)))) then { - TRACE_1("exceeded max dose",_currentDose); - _overdosedMedications pushBackUnique _className; - }; -}; - -// Check incompatible medication (format [med,limit]) -{ - _x params ["_xMed", "_xLimit"]; - private _inSystem = [_target, _xMed] call ACEFUNC(medical_status,getMedicationCount); - if (_inSystem> _xLimit) then { - _overdosedMedications pushBackUnique _xMed; - }; -} forEach _incompatibleMedication; - -if (_overdosedMedications isNotEqualTo []) then { - private _medicationConfig = (configFile >> QUOTE(ACE_ADDON(Medical_Treatment)) >> "Medication"); - private _onOverDose = getText (_medicationConfig >> "onOverDose"); - if (isClass (_medicationConfig >> _className)) then { - _medicationConfig = (_medicationConfig >> _className); - if (isText (_medicationConfig >> "onOverDose")) then { _onOverDose = getText (_medicationConfig >> "onOverDose"); }; - }; - TRACE_2("overdose",_overdosedMedications,_onOverDose); - if (_onOverDose == "") exitWith { - TRACE_1("CriticalVitals Event",_target); // make unconscious - [QACEGVAR(medical,CriticalVitals), _target] call CBA_fnc_localEvent; - }; - if (isNil _onOverDose) then { - _onOverDose = compile _onOverDose; - } else { - _onOverDose = missionNamespace getVariable _onOverDose; - }; - [_target, _className, _overdosedMedications] call _onOverDose; -};