mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Fix lost magazines when restoring gunbag mags (#4942)
This commit is contained in:
parent
1590948b92
commit
e41fbcb0fd
@ -29,6 +29,16 @@ if (_state isEqualTo []) exitWith {
|
||||
_state params ["_weapon", "_items", "_magazines"];
|
||||
|
||||
_unit addWeapon _weapon;
|
||||
|
||||
// Game will auto add magazines from player's inventory, put these back in player inventory as they will be overwritten
|
||||
([_unit, _weapon] call EFUNC(common,getWeaponState)) params ["", "", "_addedMags", "_addedAmmo"];
|
||||
{
|
||||
if (((_x select 0) != "") && {(_addedMags select _forEachIndex) != ""}) then {
|
||||
TRACE_2("Re-adding mag",_x,_addedMags select _forEachIndex);
|
||||
_unit addMagazine [_addedMags select _forEachIndex, _addedAmmo select _forEachIndex];
|
||||
};
|
||||
} forEach _magazines;
|
||||
|
||||
removeAllPrimaryWeaponItems _unit;
|
||||
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user