Skip to content
Open
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
46 changes: 38 additions & 8 deletions Altis_Life.Altis/core/shops/fn_weaponShopMags.sqf
Original file line number Diff line number Diff line change
@@ -1,21 +1,51 @@
#include "..\..\script_macros.hpp"
/*
File: fn_weaponShopMags.sqf
Author: Daniel Stuart
Authors: Daniel Stuart, Faron


Description:
Set Weapon Shop in magazine mode
*/
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","_magArray","_magWell","_subClass","_muzzles","_subCfgClass"];
_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 (count _muzzles > 0) 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 {
Expand Down