summaryrefslogtreecommitdiffstats
path: root/Client/Functions/Client_UIAddMagazine.sqf
diff options
context:
space:
mode:
authorhybrid <hybrid@hybridlabs.pro>2026-06-11 19:38:09 +0300
committerhybrid <hybrid@hybridlabs.pro>2026-06-11 19:38:09 +0300
commita3a91d4f45b22fd487ecbc954ad979be5d03efdd (patch)
treea554ab159a347dcd6c00ca1c7c26c1ec3ac0a6bd /Client/Functions/Client_UIAddMagazine.sqf
downloada2wf_chernarus-main.tar.gz
a2wf_chernarus-main.tar.bz2
a2wf_chernarus-main.zip
Diffstat (limited to '')
-rw-r--r--Client/Functions/Client_UIAddMagazine.sqf35
1 files changed, 35 insertions, 0 deletions
diff --git a/Client/Functions/Client_UIAddMagazine.sqf b/Client/Functions/Client_UIAddMagazine.sqf
new file mode 100644
index 0000000..509c515
--- /dev/null
+++ b/Client/Functions/Client_UIAddMagazine.sqf
@@ -0,0 +1,35 @@
+private ["_get","_limit","_newMagSpace","_newMagSideInv","_mag","_magazines","_size"];
+_magazines = _this select 0;
+_mag = _this select 1;
+_size = 0;
+_limit = 12;
+
+_get = _mag Call GetNamespace;
+_newMagSpace = _get select QUERYGEARSPACE;
+_newMagSideInv = _get select QUERYGEARHANDGUNPOOL;
+_limit = if (_newMagSideInv) then {8} else {12};
+
+if (_newMagSideInv) then {
+ {
+ _get = _x Call GetNamespace;
+
+ if !(isNil '_get') then {
+ if (_get select QUERYGEARHANDGUNPOOL) then {
+ _size = _size + (_get select QUERYGEARSPACE);
+ };
+ };
+ } forEach _magazines;
+} else {
+ {
+ _get = _x Call GetNamespace;
+
+ if !(isNil '_get') then {
+ if !(_get select QUERYGEARHANDGUNPOOL) then {
+ _size = _size + (_get select QUERYGEARSPACE);
+ };
+ };
+ } forEach _magazines;
+};
+
+if (_size + _newMagSpace <= _limit) then {_magazines = _magazines + [_mag]};
+_magazines \ No newline at end of file