Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Medical Treatment - Add missing bools for creating litter #10564

Merged
merged 2 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading