Skip to content

Commit

Permalink
Merge pull request #1710 from johnb432/common-improve-addBinocularMag…
Browse files Browse the repository at this point in the history
…azine

Common - Update `FUNC(addBinocularMagazine)`
  • Loading branch information
PabstMirror authored Nov 10, 2024
2 parents d2c0e07 + 4b26adf commit 1582aac
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions addons/common/fnc_addBinocularMagazine.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ Function: CBA_fnc_addBinocularMagazine
Description:
Adds a magazine to the units rangefinder.
Note that this breaks the unique magazine ids due to the usage of setUnitLoadout.
Parameters:
_unit - A unit <OBJECT>
_magazine - The magazine to add <STRING>
Expand All @@ -30,11 +28,4 @@ params [["_unit", objNull, [objNull]], ["_magazine", "", [""]], ["_ammo", nil, [

if (!local _unit) exitWith {};

if (isNil "_ammo") then {
_ammo = getNumber (configFile >> "CfgMagazines" >> _magazine >> "count");
};

private _loadout = getUnitLoadout _unit;
(_loadout select 8) set [4, [_magazine, _ammo]];

_unit setUnitLoadout _loadout;
_unit addWeaponItem [binocular _unit, [_magazine, _ammo], true];

0 comments on commit 1582aac

Please sign in to comment.