Skip to content

Commit

Permalink
use CBA_fnc_canAddItem only
Browse files Browse the repository at this point in the history
- use CBA_fnc_canAddItem only, requires #1528
  • Loading branch information
Drofseh committed Nov 28, 2021
1 parent 673d2cd commit b51c8e3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion addons/common/fnc_addMagazine.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ if (!isClass _config || {getNumber (_config >> "scope") < 2}) exitWith {
};

if (_verify) then {
if (_unit canAdd _item || {[_unit, _item, 1, true, true, true] call CBA_fnc_canAddItem}) then { // canAdd works for vehicles and units, CBA_fnc_canAddItem is more precise for units, but only try if canAdd fails for them
if ([_unit, _item, 1, true, true, true] call CBA_fnc_canAddItem) then {
if (_ammo < 0) then {
_unit addMagazine [_item, 1E6]; // addMagazine STRING is not synched when used on remote units. addMagazine ARRAY is.
} else {
Expand Down

0 comments on commit b51c8e3

Please sign in to comment.