This commit is contained in:
johnb432 2024-05-27 20:34:27 +02:00
parent be9797d11d
commit 73e1ce7f64

View File

@ -59,21 +59,6 @@ switch (_container) do {
}; };
}; };
if (_type select 0 == "magazine") then {
private _configAmmoCount = getNumber (configFile >> "CfgMagazines" >> _classname >> "count");
// https://feedback.bistudio.com/T74244
// When adding throwables with the addXXXCargo(Global) commands, they don't show up in the throwables list
// If a throwable has more than 1 ammo count, adding it with addItem(XXX) commands also renders the throwable unusable
if (_configAmmoCount == 1 && {_ammoCount in [-1, 1]} && {_classname call BIS_fnc_isThrowable}) then { // TODO: replace with https://community.bistudio.com/wiki/isThrowable in 2.18
_type set [0, "item"];
};
if (_ammoCount == -1) then {
_ammoCount = _configAmmoCount;
};
};
switch (_type select 0) do { switch (_type select 0) do {
case "weapon": { case "weapon": {
if (_canAdd || {_canFitWeaponSlot}) then { if (_canAdd || {_canFitWeaponSlot}) then {
@ -121,6 +106,10 @@ switch (_type select 0) do {
}; };
case "magazine": { case "magazine": {
if (_ammoCount == -1) then {
_ammoCount = getNumber (configFile >> "CfgMagazines" >> _classname >> "count");
};
if (_canAdd) then { if (_canAdd) then {
_addedToUnit = true; _addedToUnit = true;