Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Common - Update FUNC(addBinocularMagazine) #1710

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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];
Loading