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

Misc - Fix excessive FAK items are dropped on floor as single items #456

Merged
Changes from 1 commit
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
21 changes: 20 additions & 1 deletion addons/misc/functions/fnc_FAK_unpack.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,31 @@ params ["_unit", "_item", "_type", "_slot"];
private _fnc_arrayToInvItem = {
params ["_unit", "_array", "_container"];

private _groundContainer = nearestObjects [_unit, ["WeaponHolder_Single_F"], 2] param [0];
Tapawingo marked this conversation as resolved.
Show resolved Hide resolved

{
for "_i" from 1 to (_x select 1) do
{
[_unit, _x select 0, _container] call ACEFUNC(common,addToInventory);
private _inventory = [_unit, _x select 0, _container] call ACEFUNC(common,addToInventory);

if !(_inventory select 0) then {
if (isNil "_groundContainer") exitWith {
_groundContainer = _inventory select 1;
};

{
_groundContainer addItemCargoGlobal [_x, 1];
} forEach itemCargo (_inventory select 1);

deleteVehicle (_inventory select 1);
};
}
} foreach _array;

// Cleanup if no items were dropped
if (count itemCargo _groundContainer isEqualTo 0) then {
deleteVehicle _groundContainer;
}
};

private _fnc_getContainer = {
Expand Down