Skip to content

Commit

Permalink
faster
Browse files Browse the repository at this point in the history
  • Loading branch information
Apricot-ale committed Dec 25, 2024
1 parent 8af54a2 commit e76a41a
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions addons/medical_treatment/functions/fnc_onMedicationUsage.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,12 @@ if (_maxDose > 0) then {
};

// Check incompatible medication (format [med,limit])
if (typeName _array != "ARRAY" || _incompatibleMedication isEqualTo []) exitWith {};
{
_x params ["_xMed", "_xLimit"];
private _inSystem = ([_target, _xMed] call EFUNC(medical_status,getMedicationCount)) select 0;
if (_inSystem > _xLimit) then {
[_target, _classname, _inSystem, _xLimit, _xMed] call FUNC(overDose);
};
} forEach _incompatibleMedication;
if (_incompatibleMedication isEqualType []) then {
{
_x params ["_xMed", "_xLimit"];
private _inSystem = ([_target, _xMed] call EFUNC(medical_status,getMedicationCount)) select 0;
if (_inSystem > _xLimit) then {
[_target, _classname, _inSystem, _xLimit, _xMed] call FUNC(overDose);
};
} forEach _incompatibleMedication;
};

0 comments on commit e76a41a

Please sign in to comment.