From 496e6f822344e460312e68cd1334a0643ea28bef Mon Sep 17 00:00:00 2001 From: Josuan Albin Date: Thu, 9 Nov 2017 18:32:00 +0100 Subject: [PATCH] Replace bis_fnc_baseWeapon with CBA equivalent everywhere outisde of scanConfig --- addons/arsenal/defines.hpp | 6 +++--- addons/arsenal/functions/fnc_addVirtualItems.sqf | 6 +++--- addons/arsenal/functions/fnc_buttonLoadoutsSave.sqf | 8 ++++---- addons/arsenal/functions/fnc_onSelChangedLeft.sqf | 7 ++++--- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/addons/arsenal/defines.hpp b/addons/arsenal/defines.hpp index 5a9f1311b7..ce02f86f89 100644 --- a/addons/arsenal/defines.hpp +++ b/addons/arsenal/defines.hpp @@ -232,9 +232,9 @@ #define LIST_DEFAULTS\ [\ [\ - (primaryweapon GVAR(center) call bis_fnc_baseWeapon),\ - (secondaryweapon GVAR(center) call bis_fnc_baseWeapon),\ - (handgunweapon GVAR(center) call bis_fnc_baseWeapon)\ + (primaryweapon GVAR(center) call CBA_fnc_getNonPresetClass),\ + (secondaryweapon GVAR(center) call CBA_fnc_getNonPresetClass),\ + (handgunweapon GVAR(center) call CBA_fnc_getNonPresetClass)\ ],\ [\ [((GVAR(center) weaponAccessories (primaryWeapon GVAR(center))) select 2), ((GVAR(center) weaponAccessories (secondaryWeapon GVAR(center))) select 2), ((GVAR(center) weaponAccessories (handgunWeapon GVAR(center))) select 2)] select {!(_x isEqualTo "")},\ diff --git a/addons/arsenal/functions/fnc_addVirtualItems.sqf b/addons/arsenal/functions/fnc_addVirtualItems.sqf index 5ac220e856..8614e0c185 100644 --- a/addons/arsenal/functions/fnc_addVirtualItems.sqf +++ b/addons/arsenal/functions/fnc_addVirtualItems.sqf @@ -151,13 +151,13 @@ if (_items isEqualType true && {_items}) then { {getNumber (_configCfgWeapons >> _x >> 'type') != 4096}): { switch (getNumber (_configCfgWeapons >> _x >> "type")) do { case 1: { - (_cargo select 0) select 0 pushBackUnique ([_x] call bis_fnc_baseWeapon); + (_cargo select 0) select 0 pushBackUnique ([_x] call CBA_fnc_getNonPresetClass); }; case 2: { - (_cargo select 0) select 2 pushBackUnique ([_x] call bis_fnc_baseWeapon); + (_cargo select 0) select 2 pushBackUnique ([_x] call CBA_fnc_getNonPresetClass); }; case 4: { - (_cargo select 0) select 1 pushBackUnique ([_x] call bis_fnc_baseWeapon); + (_cargo select 0) select 1 pushBackUnique ([_x] call CBA_fnc_getNonPresetClass); }; }; }; diff --git a/addons/arsenal/functions/fnc_buttonLoadoutsSave.sqf b/addons/arsenal/functions/fnc_buttonLoadoutsSave.sqf index 260dc72837..31952f0c70 100644 --- a/addons/arsenal/functions/fnc_buttonLoadoutsSave.sqf +++ b/addons/arsenal/functions/fnc_buttonLoadoutsSave.sqf @@ -62,7 +62,7 @@ switch (GVAR(currentLoadoutsTab)) do { private _weapon = (_loadout select _dataIndex) select 0; if (_weapon != "") then { - private _baseWeapon = _weapon call BIS_fnc_baseWeapon; + private _baseWeapon = _weapon call CBA_fnc_getNonPresetClass; if (_weapon != _baseWeapon) then { (_loadout select _dataIndex) set [0, _baseWeapon]; }; @@ -84,7 +84,7 @@ switch (GVAR(currentLoadoutsTab)) do { private _weapon = (_x select 0) select 0; if (_weapon != "") then { - private _baseWeapon = _weapon call BIS_fnc_baseWeapon; + private _baseWeapon = _weapon call CBA_fnc_getNonPresetClass; if (_weapon != _baseWeapon) then { (_x select 0)set [0, _baseWeapon]; }; @@ -143,7 +143,7 @@ switch (GVAR(currentLoadoutsTab)) do { private _weapon = (_loadout select _dataIndex) select 0; if (_weapon != "") then { - private _baseWeapon = _weapon call BIS_fnc_baseWeapon; + private _baseWeapon = _weapon call CBA_fnc_getNonPresetClass; if (_weapon != _baseWeapon) then { (_loadout select _dataIndex) set [0, _baseWeapon]; }; @@ -165,7 +165,7 @@ switch (GVAR(currentLoadoutsTab)) do { private _weapon = (_x select 0) select 0; if (_weapon != "") then { - private _baseWeapon = _weapon call BIS_fnc_baseWeapon; + private _baseWeapon = _weapon call CBA_fnc_getNonPresetClass; if (_weapon != _baseWeapon) then { (_x select 0)set [0, _baseWeapon]; }; diff --git a/addons/arsenal/functions/fnc_onSelChangedLeft.sqf b/addons/arsenal/functions/fnc_onSelChangedLeft.sqf index 54375c327e..4c24150a22 100644 --- a/addons/arsenal/functions/fnc_onSelChangedLeft.sqf +++ b/addons/arsenal/functions/fnc_onSelChangedLeft.sqf @@ -31,7 +31,8 @@ private _selectCorrectPanelContainer = [_containerDefaultRightPanel, _display di switch (GVAR(currentLeftPanel)) do { case IDC_buttonPrimaryWeapon : { - private _baseWeapon = ((GVAR(currentItems) select 0) call bis_fnc_baseWeapon); + private _baseWeapon = (GVAR(currentItems) select 0) call CBA_fnc_getNonPresetClass; + TRACE_2("weapon classes", (GVAR(currentItems) select 0), _baseWeapon); if ((GVAR(currentItems) select 0) != _item && {_baseWeapon != _item}) then { { @@ -74,7 +75,7 @@ switch (GVAR(currentLeftPanel)) do { }; case IDC_buttonHandgun : { - private _baseWeapon = ((GVAR(currentItems) select 2) call bis_fnc_baseWeapon); + private _baseWeapon = (GVAR(currentItems) select 2) call CBA_fnc_getNonPresetClass; if ((GVAR(currentItems) select 2) != _item && {_baseWeapon != _item}) then { { @@ -117,7 +118,7 @@ switch (GVAR(currentLeftPanel)) do { }; case IDC_buttonSecondaryWeapon : { - private _baseWeapon = ((GVAR(currentItems) select 1) call bis_fnc_baseWeapon); + private _baseWeapon = (GVAR(currentItems) select 1) call CBA_fnc_getNonPresetClass; if ((GVAR(currentItems) select 1) != _item && {_baseWeapon != _item}) then { {