mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 12:12:34 +03:00
Fix infinite antibiotics when given to another player
Vanilla development commit:
4e6ea24577
This commit is contained in:
@@ -5,8 +5,17 @@ private ["_msg","_antibiotics","_hasAntibiotics","_id","_hasMeds","_unit"];
|
||||
_unit = _this select 0;
|
||||
_medsUsed = _this select 1;
|
||||
_antibiotics =["ItemAntibiotic","ItemAntibiotic1","ItemAntibiotic2","ItemAntibiotic3","ItemAntibiotic4","ItemAntibiotic5","ItemAntibiotic6"];
|
||||
_hasAntibiotics = false;
|
||||
|
||||
_hasAntibiotics = Array_Any(magazines player, {_this in _antibiotics});
|
||||
{
|
||||
if (_x in magazines player) exitWith {
|
||||
// Set antibiotics if not defined (used when giving to somebody)
|
||||
if(isNil "_medsUsed") then {
|
||||
_medsUsed = _x;
|
||||
};
|
||||
_hasAntibiotics = true;
|
||||
};
|
||||
} count _antibiotics;
|
||||
|
||||
_msg = "You seem to have misplaced your antibiotics.";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user