From 39f96ef242fe0b39c625fdc5a36befdc07d56139 Mon Sep 17 00:00:00 2001 From: Salbei Date: Mon, 27 Jun 2022 15:27:50 +0200 Subject: [PATCH] Fixed 2 Issues, with Medicla macro & binos --- .../functions/fnc_createBaseClass.sqf | 11 ++++------- .../functions/fnc_getLoadoutAndFormat.sqf | 18 +++++++++++++++--- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/addons/getLoadoutsFromUnits/functions/fnc_createBaseClass.sqf b/addons/getLoadoutsFromUnits/functions/fnc_createBaseClass.sqf index 367655a..b0fa0b9 100644 --- a/addons/getLoadoutsFromUnits/functions/fnc_createBaseClass.sqf +++ b/addons/getLoadoutsFromUnits/functions/fnc_createBaseClass.sqf @@ -203,7 +203,7 @@ _baseLoadout set [9, [_map, _gps, _radio, _compass, _watch, _nvgoggles]]; ["_backpackClass", []], ["_headgearClass", ""], ["_googlesClass", ""], - ["_binocluarClass", []], + ["_binocularClass", []], ["_itemsClass", []] ]; @@ -330,10 +330,8 @@ _baseLoadout set [9, [_map, _gps, _radio, _compass, _watch, _nvgoggles]]; }; }; - if (_binocularClass isNotEqualTo []) then { - if (_binocularClass select 0 isEqualTo _binocular) then { - _binocularClass set [0, nil]; - }; + if (_binocularClass isNotEqualTo [] && {(_binocularClass select 0) isEqualTo _binoculars}) then { + _binocularClass = []; }; if (_itemsClass isNotEqualTo []) then { @@ -357,8 +355,7 @@ _baseLoadout set [9, [_map, _gps, _radio, _compass, _watch, _nvgoggles]]; }; }; - - [_loadoutHash, _x, [_primaryWeaponClass, _secondaryWeaponClass, _handgunWeaponClass, _uniformClass, _vestClass, _backpackClass, _headgearClass, _googlesClass, _binocluarClass, _itemsClass]] call CBA_fnc_hashSet; + [_loadoutHash, _x, [_primaryWeaponClass, _secondaryWeaponClass, _handgunWeaponClass, _uniformClass, _vestClass, _backpackClass, _headgearClass, _googlesClass, _binocularClass, _itemsClass]] call CBA_fnc_hashSet; }; }forEach _types; diff --git a/addons/getLoadoutsFromUnits/functions/fnc_getLoadoutAndFormat.sqf b/addons/getLoadoutsFromUnits/functions/fnc_getLoadoutAndFormat.sqf index 5db98b8..eea71f4 100644 --- a/addons/getLoadoutsFromUnits/functions/fnc_getLoadoutAndFormat.sqf +++ b/addons/getLoadoutsFromUnits/functions/fnc_getLoadoutAndFormat.sqf @@ -79,13 +79,25 @@ if (!(_loadout select 5 isEqualTo []) && {!(_loadout select 5 select 1 isEqualTo _x params ["_medicalTyp", "_index"]; if (_medicalTyp isEqualTo _type) exitWith { - _return pushBack ""; - _return pushBack (_tripleTab + (["GRAD_FACTIONS_MEDICITEMS_CFR", "GRAD_FACTIONS_MEDICITEMS_SQ", "GRAD_FACTIONS_MEDICITEMS_PT"] select _index)); + _return append [ + "", + _tripleTab + "class Rank {", + _tripleTab + _tab + "class PRIVATE {", + _tripleTab + _tab + _tab + (["GRAD_FACTIONS_MEDICITEMS_CFR", "GRAD_FACTIONS_MEDICITEMS_SQ", "GRAD_FACTIONS_MEDICITEMS_PT"] select _index), + _tripleTab + _tab + "};", + _tripleTab + _tab + "class CORPORAL: PRIVATE {}", + _tripleTab + _tab + "class SERGEANT: PRIVATE {}", + _tripleTab + _tab + "class LIEUTENANT: PRIVATE {}", + _tripleTab + _tab + "class CAPTAIN: PRIVATE {}", + _tripleTab + _tab + "class MAJOR: PRIVATE {}", + _tripleTab + _tab + "class COLONEL: PRIVATE {}", + _tripleTab + "}", + "" + ]; }; }forEach _typesMedical; _return pushBack (_tab + _tab + "};"); - _return = _return select {!isNil "_x" }; _return