Skip to content

Commit

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

// Check incompatible medication (format [med,limit])
{
_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 !(isNil _incompatibleMedication) 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 8ace436

Please sign in to comment.