Skip to content
2 changes: 1 addition & 1 deletion addons/arsenal/functions/fnc_baseOptic.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ private _baseClasses = configProperties [configFile >> "CBA_PIPItems", "getText
// Carry Handle
{
_baseClasses append (configProperties [_x, "getText _x == _optic"]);
} forEach configProperties [configFile >> "CBA_CarryHandleTypes"];
} forEach ("true" configClasses (configFile >> "CBA_CarryHandleTypes"));

if (_baseClasses isNotEqualTo []) then {
_optic = configName (_baseClasses select 0);
Expand Down
2 changes: 1 addition & 1 deletion addons/arsenal/functions/fnc_sortStatement_scopeMag.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ private _minZoom = 999; // FOV, so smaller is more zoomed in

{
_minZoom = _minZoom min getNumber (_x >> "opticsZoomMin");
} forEach configProperties [_config >> "ItemInfo" >> "OpticsModes", "isClass _x"];
} forEach ("true" configClasses (_config >> "ItemInfo" >> "OpticsModes"));

if (_minZoom in [0, 999]) exitWith {"?"};

Expand Down
2 changes: 1 addition & 1 deletion addons/artillerytables/dev/checkConfigs.inc.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ private _fnc_showPropertyDefined = {
params ["_configBase", "_configProperty"];

private _customAll = configProperties [_configBase, 'isClass _x && {isNumber (_x >> _configProperty)}', true];
private _customExplicit = _customAll select {[] isNotEqualTo configProperties [_x, 'configName _x == _configProperty', false]};
private _customExplicit = _customAll select {_x == inheritsFrom (_x >> _configProperty)};
diag_log text format ["%1 with custom %2: %3 Explicit, %4 Total]", configName _configBase, _configProperty, count _customExplicit, count _customAll];
diag_log text format [" - Defined: %1", _customExplicit apply {configName _x}];
diag_log text format [" - Inherited: %1", _customAll apply {[configName _x, getNumber (_x >> _configProperty)]}];
Expand Down
2 changes: 1 addition & 1 deletion addons/common/dev/test_mapConfigs.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ private _maps = configProperties [configFile >> "CfgWorldList", "(isClass _x)",
_stepX = getNumber (_x >> "stepX");
_stepY = getNumber (_x >> "stepY");
};
} forEach configProperties [(_worldConfig >> "Grid"), "isClass _x", false];
} forEach ("true" configClasses (_worldConfig >> "Grid"));
private _stepXat5 = _stepX * 10 ^ ((count _formatX) - 5);
private _stepYat5 = -1 * _stepY * 10 ^ ((count _formatY) - 5);
if (_stepYat5 < 0) then {diag_log text format ["%1 [%2] - Northing is reversed.",_mapDescription,_mapConfigName];};
Expand Down
2 changes: 1 addition & 1 deletion addons/common/functions/fnc_getMapGridData.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ private _stepY = 1e10;
_stepX = getNumber (_x >> "stepX");
_stepY = getNumber (_x >> "stepY");
};
} forEach configProperties [_cfgGrid, "isClass _x", false];
} forEach ("true" configClasses _cfgGrid);

private _letterGrid = false;

Expand Down
2 changes: 1 addition & 1 deletion addons/csw/dev/checkStaticWeapons.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ private _inherited = [];
private _config = _x;
private _configEnabled = (getNumber (_config >> QUOTE(ADDON) >> "enabled")) == 1;
if (_configEnabled) then {
private _configExplicit = (count configProperties [_config, toString {configName _x == QUOTE(ADDON)}, false]) == 1;
private _configExplicit = (QUOTE(configName _x == QUOTE(QUOTE(ADDON))) configClasses _config) isNotEqualTo [];
if (_configExplicit) then {
_explicitBases pushBack (configName _config);
_inherited pushBack [];
Expand Down
2 changes: 1 addition & 1 deletion addons/csw/functions/fnc_statTextCondition_tripods.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@

params ["_config"];

(configProperties [configFile >> "CfgWeapons" >> configName _config >> QUOTE(ADDON) >> "assembleTo", "true", true]) isNotEqualTo []
(configProperties [configFile >> "CfgWeapons" >> configName _config >> QUOTE(ADDON) >> "assembleTo", "true", true]) isNotEqualTo [] // return
2 changes: 1 addition & 1 deletion addons/interaction/functions/fnc_initAnimActions.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -199,4 +199,4 @@ private _config = configOf _object;
[_class, 0, [], _action] call EFUNC(interact_menu,addActionToClass);
TRACE_3("add anim",_class,_anim,_x);
} forEach _positions;
} forEach configProperties [_config >> QGVAR(anims), "isClass _x"];
} forEach ("true" configClasses (_config >> QGVAR(anims)));
2 changes: 1 addition & 1 deletion addons/interaction/functions/fnc_openDoor.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ TRACE_2("openDoor",_house,_door);
if (isNull _house) exitWith {};
if (_house isKindOf "Car") exitWith {};

if ((configProperties [configOf _house >> "UserActions"]) isEqualTo []) exitWith {
if (("true" configClasses (configOf _house >> "UserActions")) isEqualTo []) exitWith {
TRACE_1("Ignore houses with no UserActions",typeOf _house); // Fix problem with Shoothouse Walls
};

Expand Down
17 changes: 11 additions & 6 deletions addons/javelin/functions/fnc_onOpticDraw.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,23 @@ private _currentMagazine = currentMagazine _currentShooter;

// Get weapon / ammo configs
private _ammoCount = _currentShooter ammo _currentWeapon;
private _weaponConfig = configProperties [configFile >> "CfgWeapons" >> _currentWeapon, QUOTE(configName _x == QUOTE(QGVAR(enabled))), false];
private _ammoConfig = if (_currentMagazine != "") then {
private _weaponConfig = configFile >> "CfgWeapons" >> _currentWeapon;
private _weaponEnabledConfig = _weaponConfig >> QGVAR(enabled);
private _ammoConfig = [];

// Only consider weapons with explicit enable configs (inheritance not allowed)
if (_weaponConfig == inheritsFrom _weaponEnabledConfig) then {
private _ammoType = getText (configFile >> "CfgMagazines" >> _currentMagazine >> "ammo");
configProperties [(configFile >> "CfgAmmo" >> _ammoType), "(configName _x) == 'ace_missileguidance'", false];
_ammoConfig = "configName _x == 'ace_missileguidance'" configClasses (configFile >> "CfgAmmo" >> _ammoType);
} else {
[]
// If weapon enable is inherited, mark as invalid
_weaponEnabledConfig = configNull;
};

// Check if loaded and javelin enabled for wepaon and missile guidance enabled for loaded ammo
if ((_ammoCount == 0) || // No ammo loaded
{(count _weaponConfig) < 1} || {(getNumber (_weaponConfig select 0)) != 1} || // Not enabled for weapon
{(count _ammoConfig) < 1} || {(getNumber ((_ammoConfig select 0) >> "enabled")) != 1} // Not enabled for ammo
{(getNumber _weaponEnabledConfig) != 1} || // Not enabled for weapon
{_ammoConfig isEqualTo []} || {(getNumber ((_ammoConfig select 0) >> "enabled")) != 1} // Not enabled for ammo
) exitWith {

__JavelinIGUITargeting ctrlShow false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ private _classID = 0;
GVAR(woundClassNamesComplex) set [10 * _classID + _forEachIndex, format ["%1%2", _className, _x]];
} forEach ["Minor", "Medium", "Large"];
_classID = _classID + 1;
} forEach configProperties [_woundsConfig, "isClass _x"];
} forEach ("true" configClasses _woundsConfig);

// --- parse damage types
GVAR(damageTypeDetails) = createHashMap;
Expand Down Expand Up @@ -109,7 +109,7 @@ TRACE_1("Found default wound handlers",count _defaultWoundHandlers);
} else {
WARNING_2("Damage type %1 refers to wound %2, but it doesn't exist: skipping.",_className,configName _x);
};
} forEach configProperties [_damageTypeSubClassConfig, "isClass _x"];
} forEach ("true" configClasses _damageTypeSubClassConfig);

GVAR(damageTypeDetails) set [_className, [_thresholds, _selectionSpecific, _woundHandlers, _damageWoundDetails]];
} forEach configProperties [_damageTypesConfig, "isClass _x"];
} forEach ("true" configClasses _damageTypesConfig);
6 changes: 3 additions & 3 deletions addons/medical_engine/functions/fnc_getItemArmor.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ GVAR(armorCache) getOrDefaultCall [_this joinString "$", {
_passThrough = 0.1 max getNumber (_entry >> "passThrough") min 1; // prevent dividing by 0
};
} else {
private _condition = format ["getText (_x >> 'hitpointName') == '%1'", _hitpoint];
private _entry = configProperties [_itemInfo >> "HitpointsProtectionInfo", _condition] param [0, configNull];
if (!isNull _entry) then {
private _entries = "getText (_x >> 'hitpointName') == _hitpoint" configClasses (_itemInfo >> "HitpointsProtectionInfo");
if (_entries isNotEqualTo []) then {
private _entry = _entries select 0;
_armor = getNumber (_entry >> "armor");
_passThrough = 0.1 max getNumber (_entry >> "passThrough") min 1;
};
Expand Down
2 changes: 1 addition & 1 deletion addons/medical_gui/functions/fnc_addTreatmentActions.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ private _fnc_condition = {
["CAManBase", 0, ["ACE_MainActions", "ACE_Medical_Radial", _actionPath], _action, true] call EFUNC(interact_menu,addActionToClass);
GVAR(selfInteractionActions) pushBack ["", 1, ["ACE_SelfActions", "ACE_Medical", _actionPath], _action];
} forEach _allowedBodyParts;
} forEach configProperties [_actionsConfig, "isClass _x"];
} forEach ("true" configClasses _actionsConfig);
2 changes: 1 addition & 1 deletion addons/medical_gui/functions/fnc_collectActions.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ GVAR(actions) = [];
private _items = getArray (_x >> "items");

GVAR(actions) pushBack [_displayName, _category, _condition, _statement, _items];
} forEach configProperties [configFile >> QEGVAR(medical_treatment,actions), "isClass _x"];
} forEach ("true" configClasses (configFile >> QEGVAR(medical_treatment,actions)));


if ("ace_dragging" call EFUNC(common,isModLoaded)) then {
Expand Down
6 changes: 4 additions & 2 deletions addons/missileguidance/dev/checkAmmoConfigs.sqf
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include "..\script_component.hpp"

diag_log text format ["----------------"];
diag_log text format ["Checking Missile"];
diag_log text format ["----------------"];
Expand All @@ -12,11 +14,11 @@ _magazines select {
private _ammo = getText (_x >> "ammo");
if ((_seenAmmo pushBackUnique toLower _ammo) == -1) then { continue };
private _ammoCfg = _cfgAmmo >> _ammo;
private _guidanceCfg = _cfgAmmo >> _ammo >> "ace_missileGuidance";
private _guidanceCfg = _ammoCfg >> QUOTE(ADDON);
private _enabled = getNumber (_guidanceCfg >> "enabled");
if (_enabled != 0) then {
diag_log text format ["%1 [used in %2] Enabled=%3", _ammo, configName _x, _enabled];
private _configs = configProperties [(configFile >> "CfgAmmo" >> _ammo), "configName _x == ""ace_missileguidance""", false];
private _configs = QUOTE(configName _x == QUOTE(QUOTE(ADDON))) configClasses (configFile >> "CfgAmmo" >> _ammo);
if (_configs isEqualTo []) then {
private _manuv = getNumber (_ammoCfg >> "maneuvrability");
diag_log text format [" WARNING: Enabled but not explicit - maneuvrability=%1", _manuv];
Expand Down
3 changes: 1 addition & 2 deletions addons/missileguidance/dev/getAmmoProperties.sqf
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include "..\script_component.hpp"

private _configs = configProperties [configFile >> "CfgAmmo", QUOTE((isClass _x) && { isClass (_x >> QUOTE(QUOTE(ADDON)))})];

private _configs = QUOTE(isClass (_x >> QUOTE(QUOTE(ADDON)))) configClasses (configFile >> "CfgAmmo");
private _seekerTypes = createHashMap;
private _navigationTypes = createHashMap;
private _attackProfiles = createHashMap;
Expand Down
22 changes: 13 additions & 9 deletions addons/missileguidance/functions/fnc_cycleAttackProfileKeyDown.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,23 @@ private _ammo = getText (configFile >> "CfgMagazines" >> _currentMagazine >> "am

TRACE_3("",_currentShooter,_currentMagazine,_ammo);

private _configAmmo = configFile >> "CfgAmmo" >> _ammo;

// Verify ammo has explicity added guidance config (ignore inheritances)
private _configs = QUOTE(configName _x == QUOTE(QUOTE(ADDON))) configClasses _configAmmo;
if (_configs isEqualTo []) exitWith {TRACE_2("not explicity enabled",_ammo,_configs)};

private _config = _configAmmo >> QUOTE(ADDON);

// Bail if guidance is disabled for this ammo
if ((getNumber (configFile >> "CfgAmmo" >> _ammo >> QUOTE(ADDON) >> "enabled")) != 1) exitWith {TRACE_1("not enabled",_ammo)};
if ((getNumber (_config >> "enabled")) != 1) exitWith {TRACE_1("not enabled",_ammo)};

private _useModeForAttackProfile = (getNumber (configFile >> "CfgAmmo" >> _ammo >> QUOTE(ADDON) >> "useModeForAttackProfile")) == 1;
private _useModeForAttackProfile = (getNumber (_config >> "useModeForAttackProfile")) == 1;
private _weaponStateToken = if (_currentShooter isEqualTo ACE_player) then { _currentShooter } else { [_currentShooter, _turretPath] };
(weaponState _weaponStateToken) params ["_weapon", "", "_mode"];
TRACE_4("",_useModeForAttackProfile,_weaponStateToken,_weapon,_mode);

// Verify ammo has explicity added guidance config (ignore inheritances)
private _configs = configProperties [(configFile >> "CfgAmmo" >> _ammo), QUOTE(configName _x == QUOTE(QUOTE(ADDON))), false];
if ((count _configs) < 1) exitWith {TRACE_2("not explicity enabled",_ammo,_configs)};

private _attackProfiles = getArray (configFile >> "CfgAmmo" >> _ammo >> QUOTE(ADDON) >> "attackProfiles");
private _attackProfiles = getArray (_config >> "attackProfiles");
if ((count _attackProfiles) <= 1) exitWith {TRACE_1("no choices for attack profile",_attackProfiles)};

private _currentFireMode = if (_useModeForAttackProfile) then {
Expand All @@ -69,7 +73,7 @@ private _currentFireMode = if (_useModeForAttackProfile) then {
// Just like onFired, this is case sensitive!
private _index = _attackProfiles find _currentFireMode;
if (_index == -1) then {
_index = _attackProfiles find (getText (configFile >> "CfgAmmo" >> _ammo >> QUOTE(ADDON) >> "defaultAttackProfile"));
_index = _attackProfiles find (getText (_config >> "defaultAttackProfile"));
};
_index = (_index + 1) % (count _attackProfiles);
private _nextFireMode = _attackProfiles select _index;
Expand All @@ -92,7 +96,7 @@ if (_useModeForAttackProfile) then {

playSound "ACE_Sound_Click";

if ((getNumber (configFile >> "CfgAmmo" >> _ammo >> QUOTE(ADDON) >> "showHintOnCycle")) == 1) then {
if ((getNumber (_config >> "showHintOnCycle")) == 1) then {
private _localizedName = getText (configFile >> QGVAR(AttackProfiles) >> _nextFireMode >> "name");
[_localizedName] call EFUNC(common,displayTextStructured);
};
8 changes: 5 additions & 3 deletions addons/missileguidance/functions/fnc_onFired.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@
* Public: No
*/

params ["_shooter","_weapon","","_mode","_ammo","","_projectile"];
params ["_shooter", "", "", "", "_ammo", "", "_projectile"];

private _configAmmo = configFile >> "CfgAmmo" >> _ammo;

// Bail if guidance is disabled for this ammo
if ((getNumber (configFile >> "CfgAmmo" >> _ammo >> QUOTE(ADDON) >> "enabled")) != 1) exitWith {};
if ((getNumber (_configAmmo >> QUOTE(ADDON) >> "enabled")) != 1) exitWith {};

// Bail on locality of the projectile, it should be local to us
if (GVAR(enabled) < 1 || {!local _projectile} ) exitWith {};
Expand All @@ -31,7 +33,7 @@ if (GVAR(enabled) < 1 || {!local _projectile} ) exitWith {};
if ( !isPlayer _shooter && { GVAR(enabled) < 2 } ) exitWith {};

// Verify ammo has explicity added guidance config (ignore inheritances)
private _configs = configProperties [(configFile >> "CfgAmmo" >> _ammo), QUOTE(configName _x == QUOTE(QUOTE(ADDON))), false];
private _configs = QUOTE(configName _x == QUOTE(QUOTE(ADDON))) configClasses _configAmmo;
if (_configs isEqualTo []) exitWith {};

private _args = call FUNC(onFiredGetArgs);
Expand Down
2 changes: 1 addition & 1 deletion addons/rearm/functions/fnc_addVehicleMagazinesToSupply.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ private _turrets = [_vehicle] call FUNC(getAllRearmTurrets);
} forEach _turrets;

// 1.70 pylons
private _pylonConfigs = configProperties [configFile >> "CfgVehicles" >> _vehicle >> "Components" >> "TransportPylonsComponent" >> "Pylons", "isClass _x"];
private _pylonConfigs = "true" configClasses (configFile >> "CfgVehicles" >> _vehicle >> "Components" >> "TransportPylonsComponent" >> "Pylons");
{
private _defaultMag = getText (_x >> "attachment");
TRACE_3("",_defaultMag,configName _x,_forEachIndex);
Expand Down
2 changes: 1 addition & 1 deletion addons/rearm/functions/fnc_getNeedRearmMagazines.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ params ["_vehicle"];
private _magazineInfo = [];

// 1.70 pylons
private _pylonConfigs = configProperties [configOf _vehicle >> "Components" >> "TransportPylonsComponent" >> "Pylons", "isClass _x"];
private _pylonConfigs = "true" configClasses (configOf _vehicle >> "Components" >> "TransportPylonsComponent" >> "Pylons");
{
// Strangely, a 1-based index.
private _pylonIndex = _forEachIndex + 1;
Expand Down
2 changes: 1 addition & 1 deletion addons/scopes/dev/checkScopes.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ private _fnc_checkConfig = {
if (_diag) then {
diag_log text format [" %1[%2] = %3 (%4)",configName _x, _xZoom, _xMem, _xOffset];
};
} forEach configProperties [_config >> "ItemInfo" >> "OpticsModes", "isClass _x"];
} forEach ("true" configClasses (_config >> "ItemInfo" >> "OpticsModes"));
deleteVehicle _weaponObj;
_bestOffset
};
Expand Down
5 changes: 3 additions & 2 deletions addons/spike/functions/fnc_keyDown.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@

private _currentWeapon = currentWeapon ACE_player;
if !(GVAR(launcherWeapons) getOrDefaultCall [_currentWeapon, {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might even be able to remove the cache, as it's quite quick.

private _weaponConfig = configProperties [configFile >> "CfgWeapons" >> _currentWeapon, QUOTE(configName _x == QUOTE(QGVAR(enabled))), false];
(_weaponConfig isNotEqualTo []) && {(getNumber (_weaponConfig select 0)) == 1}
private _weaponConfig = configFile >> "CfgWeapons" >> _currentWeapon;

_weaponConfig == inheritsFrom (_weaponConfig >> QGVAR(enabled))
}, true]) exitWith {};

params ["_key", "_down"];
Expand Down
2 changes: 1 addition & 1 deletion addons/wardrobe/dev/check.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Author: PabstMirror
* call compile preprocessFileLineNumbers "z\ace\addons\wardrobe\dev\check.sqf";
*/
private _all = configProperties [configFile >> "ace_wardrobe", "true"];
private _all = "true" configClasses (configFile >> QUOTE(ADDON));

private _cfgW = configFile >> "CfgWeapons";
private _cfgG = configFile >> "CfgGlasses";
Expand Down
7 changes: 2 additions & 5 deletions addons/weather/functions/fnc_getMapData.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,8 @@ if !(isNull (_missionCfgPath >> "ACE_TempDay")) then {
_cfgPath = _missionCfgPath;
};

// Get all non inherited arrays to filter maps that inherit from Stratis/Altis/Tanoa
private _nonInheritedArrays = configProperties [_cfgPath, "isArray _x", false];

// And check if any custom non-inherited weather is defined through config and use that if so
if ((_cfgPath >> "ACE_TempDay") in _nonInheritedArrays) exitWith {
// Check if any custom non-inherited weather from Stratis/Altis/Tanoa is defined through config and use that if so
if (_cfgPath == inheritsFrom (_cfgPath >> "ACE_TempDay")) exitWith {
if (isArray (_cfgPath >> "ACE_TempDay")) then {
GVAR(TempDay) = getArray (_cfgPath >> "ACE_TempDay");
};
Expand Down