Skip to content

Commit

Permalink
Medical Treatment - Add missing bools for creating litter (#10564)
Browse files Browse the repository at this point in the history
* Add missing bools for creating litter

* Update fnc_useItem.sqf
  • Loading branch information
johnb432 authored Dec 18, 2024
1 parent 3786b8c commit c435be3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion addons/medical_treatment/functions/fnc_treatment.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ if (_treatmentTime == 0) exitWith {false};
private _userAndItem = if (GET_NUMBER_ENTRY(_config >> "consumeItem") == 1) then {
[_medic, _patient, getArray (_config >> "items")] call FUNC(useItem);
} else {
[objNull, ""]; // Treatment does not require items to be consumed
[objNull, "", false]; // Treatment does not require items to be consumed
};

_userAndItem params ["_itemUser", "_usedItem", "_createLitter"];
Expand Down
14 changes: 7 additions & 7 deletions addons/medical_treatment/functions/fnc_useItem.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* 2: Items <ARRAY>
*
* Return Value:
* User and Item and Litter Created<ARRAY>
* User and Item and Litter Created <ARRAY>
*
* Example:
* [player, cursorObject, ["bandage"]] call ace_medical_treatment_fnc_useItem
Expand All @@ -21,7 +21,7 @@
params ["_medic", "_patient", "_items"];

if (_medic isEqualTo player && {!isNull findDisplay 312}) exitWith {
[_medic, _items select 0]
[_medic, _items select 0, false] // return
};

scopeName "Main";
Expand All @@ -40,24 +40,24 @@ private _useOrder = [[_patient, _medic], [_medic, _patient], [_medic]] select GV
switch (true) do {
case (_x in _vehicleItems): {
_unitVehicle addItemCargoGlobal [_x, -1];
[_unit, _x, false] breakOut "Main";
[_unit, _x, false] breakOut "Main"; // return
};
case (_x in _vehicleMagazines): {
[_unitVehicle, _x] call EFUNC(common,adjustMagazineAmmo);
[_unit, _x, false] breakOut "Main";
[_unit, _x, false] breakOut "Main"; // return
};
case (_x in _unitItems): {
_unit removeItem _x;
[_unit, _x, true] breakOut "Main";
[_unit, _x, true] breakOut "Main"; // return
};
case (_x in _unitMagazines): {
private _magsStart = count magazines _unit;
[_unit, _x] call EFUNC(common,adjustMagazineAmmo);
private _magsEnd = count magazines _unit;
[_unit, _x, (_magsEnd < _magsStart)] breakOut "Main";
[_unit, _x, (_magsEnd < _magsStart)] breakOut "Main"; // return
};
};
} forEach _items;
} forEach _useOrder;

[objNull, "", false]
[objNull, "", false] // return

0 comments on commit c435be3

Please sign in to comment.