mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Grenades - Use fnc_addToInventory (#8016)
* Try and put converted item back in the same container * Update addons/grenades/functions/fnc_addChangeFuseItemContextMenuOptions.sqf Co-authored-by: Dystopian <sddex@ya.ru> * Update addons/grenades/functions/fnc_addChangeFuseItemContextMenuOptions.sqf Co-authored-by: Dystopian <sddex@ya.ru> * Less hacky handling of container names * Return value convention Co-authored-by: Dystopian <sddex@ya.ru>
This commit is contained in:
parent
50f740f9be
commit
8eccabbc0a
@ -33,9 +33,25 @@
|
||||
}
|
||||
],
|
||||
{
|
||||
params ["_unit", "", "", "", "_magArr"];
|
||||
_unit addMagazine (_magArr select 1);
|
||||
false;
|
||||
params ["_unit", "", "", "_slot", "_magArr"];
|
||||
private _container = "";
|
||||
switch _slot do {
|
||||
case "UNIFORM_CONTAINER": {
|
||||
_container = "uniform";
|
||||
};
|
||||
case "VEST_CONTAINER": {
|
||||
_container = "vest";
|
||||
};
|
||||
case "BACKPACK_CONTAINER": {
|
||||
_container = "backpack";
|
||||
};
|
||||
};
|
||||
|
||||
if (_container != "") then {
|
||||
[_unit, _magArr select 1, _container] call EFUNC(common,addToInventory);
|
||||
};
|
||||
|
||||
false
|
||||
},
|
||||
true,
|
||||
[_mag,_throwableMag]
|
||||
@ -55,9 +71,25 @@
|
||||
}
|
||||
],
|
||||
{
|
||||
params ["_unit", "", "", "", "_magArr"];
|
||||
_unit addMagazine (_magArr select 0);
|
||||
false;
|
||||
params ["_unit", "", "", "_slot", "_magArr"];
|
||||
private _container = "";
|
||||
switch _slot do {
|
||||
case "UNIFORM_CONTAINER": {
|
||||
_container = "uniform";
|
||||
};
|
||||
case "VEST_CONTAINER": {
|
||||
_container = "vest";
|
||||
};
|
||||
case "BACKPACK_CONTAINER": {
|
||||
_container = "backpack";
|
||||
};
|
||||
};
|
||||
|
||||
if (_container != "") then {
|
||||
[_unit, _magArr select 0, _container] call EFUNC(common,addToInventory);
|
||||
};
|
||||
|
||||
false
|
||||
},
|
||||
true,
|
||||
[_mag,_throwableMag]
|
||||
|
Loading…
Reference in New Issue
Block a user