Skip to content

Commit

Permalink
Misc - Fix excessive FAK items are dropped on floor as single items (#…
Browse files Browse the repository at this point in the history
…456)

**When merged this pull request will:**
- Fix excessive FAK items being dropped as single items
- Resolve issue reported on discord

### IMPORTANT

- [Development Guidelines](https://ace3.acemod.org/wiki/development/)
are read, understood and applied.
- Title of this PR uses our standard template `Component -
Add|Fix|Improve|Change|Make|Remove {changes}`.
  • Loading branch information
Tapawingo authored Mar 1, 2024
1 parent fd4da78 commit bad40dc
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion addons/misc/functions/fnc_FAK_unpack.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,24 @@ params ["_unit", "_item", "_type", "_slot"];
private _fnc_arrayToInvItem = {
params ["_unit", "_array", "_container"];

private _groundContainer = nearestObjects [_unit, ["GroundWeaponHolder", "WeaponHolder", "Library_WeaponHolder", "WeaponHolderSimulated"], 2] param [0];

{
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;
};
Expand Down

0 comments on commit bad40dc

Please sign in to comment.