From e2b97be99fc3280759d7ea540638f95414fc5596 Mon Sep 17 00:00:00 2001 From: TaktischerSpeck Date: Tue, 7 Apr 2020 10:54:48 +0200 Subject: [PATCH 1/2] Update fn_weaponShopMags.sqf --- .../core/shops/fn_weaponShopMags.sqf | 54 +++++++++++++++---- 1 file changed, 45 insertions(+), 9 deletions(-) diff --git a/Altis_Life.Altis/core/shops/fn_weaponShopMags.sqf b/Altis_Life.Altis/core/shops/fn_weaponShopMags.sqf index bfce38536..b6e89da38 100644 --- a/Altis_Life.Altis/core/shops/fn_weaponShopMags.sqf +++ b/Altis_Life.Altis/core/shops/fn_weaponShopMags.sqf @@ -1,7 +1,8 @@ #include "..\..\script_macros.hpp" /* File: fn_weaponShopMags.sqf - Author: Daniel Stuart + Authors: Daniel Stuart, Faron, TaktischerSpeck + Description: Set Weapon Shop in magazine mode @@ -9,15 +10,50 @@ disableSerialization; if ((uiNamespace getVariable ["Weapon_Magazine",0]) isEqualTo 0) then { - private _weapon = lbData[38403,lbCurSel (38403)]; - private _magArray = FETCH_CONFIG2(getArray,"CfgWeapons",_weapon,"magazines"); - { - if (_x in FETCH_CONFIG2(getArray,"CfgWeapons",_weapon,"muzzles")) then { - _magArray append FETCH_CONFIG(getArray,"CfgWeapons",_weapon,_x,"magazines"); - }; - } count ["EGLM", "GL_3GL_F"]; + private _weapon = 0; + private _magArray = []; + private _magWell = []; + private _subClass = 0; + private _muzzles = []; + private _subCfgClass = 0; + + _weapon = lbData[38403,lbCurSel (38403)]; + _magArray = getArray (configFile >> "CfgWeapons" >> _weapon >> "magazines"); + + _magWell = getArray (configFile >> "CfgWeapons" >> _weapon >> "magazineWell"); + { + _subClass = _x; + _subCfgClass = configProperties [configFile >> "CfgMagazineWells" >> _subClass]; + + { + _magArray append getArray _x; + true; + } count _subCfgClass; + true; + } count _magWell; + + //GL and stuff + _muzzles = (getArray (configFile >> "CfgWeapons" >> _weapon >> "muzzles")) - ["this"]; + if (_muzzles isEqualTo []) then { + { + _magArray append getArray (configFile >> "CfgWeapons" >> _weapon >> _x >> "magazines"); + _magWell = getArray (configFile >> "CfgWeapons" >> _weapon >> _x >> "magazineWell"); + { + _subClass = _x; + _subCfgClass = configProperties [configFile >> "CfgMagazineWells" >> _subClass]; + + { + _magArray append getArray _x; + true; + } count _subCfgClass; + true; + } count _magWell; + true; + } count _muzzles; + }; + uiNamespace setVariable ["Magazine_Array",_magArray]; uiNamespace setVariable ["Weapon_Magazine",1]; } else { uiNamespace setVariable ["Weapon_Magazine",0]; -}; +}; \ No newline at end of file From ab18f38b1e2798b378098ecb7ad5598a37d2203f Mon Sep 17 00:00:00 2001 From: TaktischerSpeck Date: Tue, 7 Apr 2020 15:32:06 +0200 Subject: [PATCH 2/2] Update fn_weaponShopMags.sqf --- .../core/shops/fn_weaponShopMags.sqf | 66 +++++++++---------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/Altis_Life.Altis/core/shops/fn_weaponShopMags.sqf b/Altis_Life.Altis/core/shops/fn_weaponShopMags.sqf index b6e89da38..13723edbb 100644 --- a/Altis_Life.Altis/core/shops/fn_weaponShopMags.sqf +++ b/Altis_Life.Altis/core/shops/fn_weaponShopMags.sqf @@ -2,7 +2,7 @@ /* File: fn_weaponShopMags.sqf Authors: Daniel Stuart, Faron, TaktischerSpeck - + Description: Set Weapon Shop in magazine mode @@ -19,39 +19,39 @@ if ((uiNamespace getVariable ["Weapon_Magazine",0]) isEqualTo 0) then { _weapon = lbData[38403,lbCurSel (38403)]; _magArray = getArray (configFile >> "CfgWeapons" >> _weapon >> "magazines"); - + _magWell = getArray (configFile >> "CfgWeapons" >> _weapon >> "magazineWell"); - { - _subClass = _x; - _subCfgClass = configProperties [configFile >> "CfgMagazineWells" >> _subClass]; - - { - _magArray append getArray _x; - true; - } count _subCfgClass; - true; - } count _magWell; - - //GL and stuff - _muzzles = (getArray (configFile >> "CfgWeapons" >> _weapon >> "muzzles")) - ["this"]; - if (_muzzles isEqualTo []) then { - { - _magArray append getArray (configFile >> "CfgWeapons" >> _weapon >> _x >> "magazines"); - _magWell = getArray (configFile >> "CfgWeapons" >> _weapon >> _x >> "magazineWell"); - { - _subClass = _x; - _subCfgClass = configProperties [configFile >> "CfgMagazineWells" >> _subClass]; - - { - _magArray append getArray _x; - true; - } count _subCfgClass; - true; - } count _magWell; - true; - } count _muzzles; - }; - + { + _subClass = _x; + _subCfgClass = configProperties [configFile >> "CfgMagazineWells" >> _subClass]; + + { + _magArray append getArray _x; + true; + } count _subCfgClass; + true; + } count _magWell; + + //GL and stuff + _muzzles = (getArray (configFile >> "CfgWeapons" >> _weapon >> "muzzles")) - ["this"]; + if (_muzzles isEqualTo []) then { + { + _magArray append getArray (configFile >> "CfgWeapons" >> _weapon >> _x >> "magazines"); + _magWell = getArray (configFile >> "CfgWeapons" >> _weapon >> _x >> "magazineWell"); + { + _subClass = _x; + _subCfgClass = configProperties [configFile >> "CfgMagazineWells" >> _subClass]; + + { + _magArray append getArray _x; + true; + } count _subCfgClass; + true; + } count _magWell; + true; + } count _muzzles; + }; + uiNamespace setVariable ["Magazine_Array",_magArray]; uiNamespace setVariable ["Weapon_Magazine",1]; } else {