From 9af367d171f0423b57e791faed85d2efbf426b63 Mon Sep 17 00:00:00 2001 From: Phyma Date: Fri, 26 May 2017 23:17:58 +0200 Subject: [PATCH 1/2] Linking belt refatoring startLinking belt now uses canLinkBelt so if condition needs to be changed then you can do it on one position. --- addons/reload/functions/fnc_startLinkingBelt.sqf | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/addons/reload/functions/fnc_startLinkingBelt.sqf b/addons/reload/functions/fnc_startLinkingBelt.sqf index a1cc73635d3..e60e2750fcd 100644 --- a/addons/reload/functions/fnc_startLinkingBelt.sqf +++ b/addons/reload/functions/fnc_startLinkingBelt.sqf @@ -16,15 +16,10 @@ params ["_player", "_target"]; if (vehicle _target != _target) exitWith {false}; private _magazineType = currentMagazine _target; -private _magazineCfg = configFile >> "CfgMagazines" >> _magazineType; -if (getNumber (_magazineCfg >> "ACE_isBelt") == 0) exitWith {false}; +private _canLink = [_player, _target] call FUNC(canLinkBelt); -// Check if the ammo is not empty or full -private _ammoCount = _target ammo currentWeapon _target; - -// Exit if the belt is full or empty -if ((_ammoCount == 0) || (getNumber (_magazineCfg >> "count") - _ammoCount) == 0) exitWith {false}; +if(!_canLink) exitWith{}; // Check if the player has any of the same same magazines // Calculate max ammo it can link From 6f11ca0ad09eb24760a9433e9479d1ee60317bfb Mon Sep 17 00:00:00 2001 From: Phyma Date: Fri, 26 May 2017 23:33:34 +0200 Subject: [PATCH 2/2] Fixed requested change Fixed requested change --- addons/reload/functions/fnc_startLinkingBelt.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/reload/functions/fnc_startLinkingBelt.sqf b/addons/reload/functions/fnc_startLinkingBelt.sqf index e60e2750fcd..b43a515a3db 100644 --- a/addons/reload/functions/fnc_startLinkingBelt.sqf +++ b/addons/reload/functions/fnc_startLinkingBelt.sqf @@ -19,7 +19,7 @@ private _magazineType = currentMagazine _target; private _canLink = [_player, _target] call FUNC(canLinkBelt); -if(!_canLink) exitWith{}; +if ( !_canLink ) exitWith {} ; // Check if the player has any of the same same magazines // Calculate max ammo it can link