From da4c08fb6c2d63b42a97219c64cbfa4790cf3df3 Mon Sep 17 00:00:00 2001 From: jonpas Date: Tue, 24 May 2016 20:51:10 +0200 Subject: [PATCH] QGVAR all reload events --- addons/reload/XEH_postInit.sqf | 10 +++++----- addons/reload/config.cpp | 4 ++-- addons/reload/functions/fnc_startLinkingBelt.sqf | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/addons/reload/XEH_postInit.sqf b/addons/reload/XEH_postInit.sqf index 5ce2096118..193fdaf79b 100644 --- a/addons/reload/XEH_postInit.sqf +++ b/addons/reload/XEH_postInit.sqf @@ -27,7 +27,7 @@ if (!hasInterface) exitWith {}; }] call CBA_fnc_addEventHandler; // Listen for attempts to link ammo -["ace_linkedAmmo", { +[QGVAR(linkedAmmo), { params ["_receiver", "_giver", "_magazine"]; private _magazineType = currentMagazine _receiver; @@ -35,7 +35,7 @@ if (!hasInterface) exitWith {}; // Return the magazine if it's the wrong type if (_magazineType != (_magazine select 0)) exitWith { - ["ace_returnedAmmo", [_giver,_receiver,_magazine], [_giver]] call CBA_fnc_targetEvent; + [QGVAR(returnedAmmo), [_giver,_receiver,_magazine], [_giver]] call CBA_fnc_targetEvent; }; private _ammoCount = _receiver ammo currentWeapon _receiver; @@ -43,7 +43,7 @@ if (!hasInterface) exitWith {}; // Return the magazine if the belt is full or empty if ((_ammoCount == 0) || _ammoMissing == 0) exitWith { - ["ace_returnedAmmo", [_giver,_receiver,_magazine], [_giver]] call CBA_fnc_targetEvent; + [QGVAR(returnedAmmo), [_giver,_receiver,_magazine], [_giver]] call CBA_fnc_targetEvent; }; // Add the ammo @@ -51,12 +51,12 @@ if (!hasInterface) exitWith {}; [QGVAR(syncAmmo), [_receiver, currentWeapon _receiver, _ammoCount + _ammoAdded]] call CBA_fnc_globalEvent; if ((_magazine select 1) - _ammoAdded > 0) then { - ["ace_returnedAmmo", [_giver, _receiver, [_magazineType, (_magazine select 1) - _ammoAdded]], [_giver]] call CBA_fnc_targetEvent; + [QGVAR(returnedAmmo), [_giver, _receiver, [_magazineType, (_magazine select 1) - _ammoAdded]], [_giver]] call CBA_fnc_targetEvent; }; }] call CBA_fnc_addEventHandler; // Listen for returned magazines -["ace_returnedAmmo", { +[QGVAR(returnedAmmo), { params ["_receiver", "", "_magazine"]; TRACE_2("returnedAmmo EH",_receiver,_magazine); diff --git a/addons/reload/config.cpp b/addons/reload/config.cpp index 8d773efa4b..8910929376 100644 --- a/addons/reload/config.cpp +++ b/addons/reload/config.cpp @@ -24,6 +24,6 @@ class CfgPatches { class ACE_newEvents { setAmmoSync = QGVAR(syncAmmo); - returnedAmmo = "ace_returnedAmmo"; - linkedAmmo = "ace_linkedAmmo"; + returnedAmmo = QGVAR(returnedAmmo); + linkedAmmo = QGVAR(linkedAmmo); }; diff --git a/addons/reload/functions/fnc_startLinkingBelt.sqf b/addons/reload/functions/fnc_startLinkingBelt.sqf index ba5d4ddca4..8b8768dbba 100644 --- a/addons/reload/functions/fnc_startLinkingBelt.sqf +++ b/addons/reload/functions/fnc_startLinkingBelt.sqf @@ -46,7 +46,7 @@ private _onFinish = { (_this select 0) params ["_player", "_target", "_magazine"]; // Raise event on remote unit - ["ace_linkedAmmo", [_target, _player, _magazine], [_target]] call CBA_fnc_targetEvent; + [QGVAR(linkedAmmo), [_target, _player, _magazine], [_target]] call CBA_fnc_targetEvent; }; private _onFailure = {