mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Arsenal - Improve addWeaponItem
usage (#8813)
* reload magazine instantly on arsenal * remove comment in reloadlaunchers * use addWeaponItem in selChangedRight
This commit is contained in:
parent
8cf900a1bc
commit
615afee022
@ -61,7 +61,7 @@ switch (GVAR(currentLeftPanel)) do {
|
|||||||
private _compatibleMags = ([_item, true] call CBA_fnc_compatibleMagazines) select { getNumber (_cfgMags >> _x >> "scope") == 2 };
|
private _compatibleMags = ([_item, true] call CBA_fnc_compatibleMagazines) select { getNumber (_cfgMags >> _x >> "scope") == 2 };
|
||||||
GVAR(center) addWeapon _item;
|
GVAR(center) addWeapon _item;
|
||||||
if (_compatibleMags isNotEqualTo []) then {
|
if (_compatibleMags isNotEqualTo []) then {
|
||||||
GVAR(center) addWeaponItem [_item, [_compatibleMags select 0]];
|
GVAR(center) addWeaponItem [_item, [_compatibleMags select 0], true];
|
||||||
};
|
};
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -103,7 +103,7 @@ switch (GVAR(currentLeftPanel)) do {
|
|||||||
private _compatibleMags = ([_item, true] call CBA_fnc_compatibleMagazines) select { getNumber (_cfgMags >> _x >> "scope") == 2 };
|
private _compatibleMags = ([_item, true] call CBA_fnc_compatibleMagazines) select { getNumber (_cfgMags >> _x >> "scope") == 2 };
|
||||||
GVAR(center) addWeapon _item;
|
GVAR(center) addWeapon _item;
|
||||||
if (_compatibleMags isNotEqualTo []) then {
|
if (_compatibleMags isNotEqualTo []) then {
|
||||||
GVAR(center) addWeaponItem [_item, [_compatibleMags select 0]];
|
GVAR(center) addWeaponItem [_item, [_compatibleMags select 0], true];
|
||||||
};
|
};
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -144,7 +144,7 @@ switch (GVAR(currentLeftPanel)) do {
|
|||||||
private _compatibleMags = ([_item, true] call CBA_fnc_compatibleMagazines) select { getNumber (_cfgMags >> _x >> "scope") == 2 };
|
private _compatibleMags = ([_item, true] call CBA_fnc_compatibleMagazines) select { getNumber (_cfgMags >> _x >> "scope") == 2 };
|
||||||
GVAR(center) addWeapon _item;
|
GVAR(center) addWeapon _item;
|
||||||
if (_compatibleMags isNotEqualTo []) then {
|
if (_compatibleMags isNotEqualTo []) then {
|
||||||
GVAR(center) addWeaponItem [_item, [_compatibleMags select 0]];
|
GVAR(center) addWeaponItem [_item, [_compatibleMags select 0], true];
|
||||||
};
|
};
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -33,7 +33,7 @@ private _fnc_selectItem = {
|
|||||||
private _primaryMags = primaryWeaponMagazine GVAR(center);
|
private _primaryMags = primaryWeaponMagazine GVAR(center);
|
||||||
GVAR(currentItems) set [18, (primaryWeaponItems GVAR(center)) + ([_primaryMags + [""], _primaryMags] select (count _primaryMags > 1))];
|
GVAR(currentItems) set [18, (primaryWeaponItems GVAR(center)) + ([_primaryMags + [""], _primaryMags] select (count _primaryMags > 1))];
|
||||||
} else {
|
} else {
|
||||||
GVAR(center) addPrimaryWeaponItem _item;
|
GVAR(center) addWeaponItem [primaryWeapon GVAR(center), _item, true];
|
||||||
private _primaryMags = primaryWeaponMagazine GVAR(center);
|
private _primaryMags = primaryWeaponMagazine GVAR(center);
|
||||||
GVAR(currentItems) set [18, (primaryWeaponItems GVAR(center)) + ([_primaryMags + [""], _primaryMags] select (count _primaryMags > 1))];
|
GVAR(currentItems) set [18, (primaryWeaponItems GVAR(center)) + ([_primaryMags + [""], _primaryMags] select (count _primaryMags > 1))];
|
||||||
};
|
};
|
||||||
@ -47,7 +47,7 @@ private _fnc_selectItem = {
|
|||||||
private _secondaryMags = secondaryWeaponMagazine GVAR(center);
|
private _secondaryMags = secondaryWeaponMagazine GVAR(center);
|
||||||
GVAR(currentItems) set [19, (secondaryWeaponItems GVAR(center)) + ([_secondaryMags + [""], _secondaryMags] select (count _secondaryMags > 1))];
|
GVAR(currentItems) set [19, (secondaryWeaponItems GVAR(center)) + ([_secondaryMags + [""], _secondaryMags] select (count _secondaryMags > 1))];
|
||||||
} else {
|
} else {
|
||||||
GVAR(center) addSecondaryWeaponItem _item;
|
GVAR(center) addWeaponItem [secondaryWeapon GVAR(center), _item, true];
|
||||||
private _secondaryMags = secondaryWeaponMagazine GVAR(center);
|
private _secondaryMags = secondaryWeaponMagazine GVAR(center);
|
||||||
GVAR(currentItems) set [19, (secondaryWeaponItems GVAR(center)) + ([_secondaryMags + [""], _secondaryMags] select (count _secondaryMags > 1))];
|
GVAR(currentItems) set [19, (secondaryWeaponItems GVAR(center)) + ([_secondaryMags + [""], _secondaryMags] select (count _secondaryMags > 1))];
|
||||||
};
|
};
|
||||||
@ -60,7 +60,7 @@ private _fnc_selectItem = {
|
|||||||
private _handgunMags = handgunMagazine GVAR(center);
|
private _handgunMags = handgunMagazine GVAR(center);
|
||||||
GVAR(currentItems) set [20, (handgunItems GVAR(center)) + ([_handgunMags + [""], _handgunMags] select (count _handgunMags > 1))];
|
GVAR(currentItems) set [20, (handgunItems GVAR(center)) + ([_handgunMags + [""], _handgunMags] select (count _handgunMags > 1))];
|
||||||
} else {
|
} else {
|
||||||
GVAR(center) addHandgunItem _item;
|
GVAR(center) addWeaponItem [handgunWeapon GVAR(center), _item, true];
|
||||||
private _handgunMags = handgunMagazine GVAR(center);
|
private _handgunMags = handgunMagazine GVAR(center);
|
||||||
GVAR(currentItems) set [20, (handgunItems GVAR(center)) + ([_handgunMags + [""], _handgunMags] select (count _handgunMags > 1))];
|
GVAR(currentItems) set [20, (handgunItems GVAR(center)) + ([_handgunMags + [""], _handgunMags] select (count _handgunMags > 1))];
|
||||||
};
|
};
|
||||||
|
@ -26,5 +26,4 @@ _target selectWeapon _weapon;
|
|||||||
if (currentWeapon _target != _weapon) exitWith {};
|
if (currentWeapon _target != _weapon) exitWith {};
|
||||||
if (currentMagazine _target != "") exitWith {};
|
if (currentMagazine _target != "") exitWith {};
|
||||||
|
|
||||||
// command is wip, reload time for launchers is not intended.
|
|
||||||
_target addWeaponItem [_weapon, _magazine, true];
|
_target addWeaponItem [_weapon, _magazine, true];
|
||||||
|
Loading…
Reference in New Issue
Block a user