General - Cleanup CfgPatches unit/weapon arrays (#8524)

* General - Cleanup CfgPatches unit/weapon arrays
add test tool
fix refuel pump
fix flashlight pistol transport type
fix iDAB reammo box

* Update config.cpp
This commit is contained in:
PabstMirror 2021-10-15 13:48:33 -05:00 committed by GitHub
parent 916346ae59
commit 93b7722716
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
24 changed files with 114 additions and 29 deletions

View File

@ -121,6 +121,7 @@ class CfgVehicles {
class Land_HelipadEmpty_F;
class ACE_LogicDummy: Land_HelipadEmpty_F {
scope = 1;
scopeCurator = 0;
SLX_XEH_DISABLED = 1;
author = CSTRING(ACETeam);
class EventHandlers {

View File

@ -72,4 +72,5 @@ class ACE_Extensions {};
class ACE_Tests {
vehicleTransportInventory = QPATHTOF(dev\test_vehicleInventory.sqf);
mapConfigs = QPATHTOF(dev\test_mapConfigs.sqf);
cfgPatches = QPATHTOF(dev\test_cfgPatches.sqf);
};

View File

@ -0,0 +1,72 @@
#include "\z\ace\addons\common\script_component.hpp"
// PabstMirror
// ["cfgPatches"] call ace_common_fnc_runTests;
diag_log text format ["--- Checking CfgPatches --- "];
private _testPass = true;
// All ace cfgPatches
private _allPatches = "(configName _x) select [0,3] == 'ace'" configClasses (configFile >> "CfgPatches");
// Get all units[]
private _allUnits = [];
{
_allUnits append ((getArray (_x >> "units")) apply { toLower _x });
} forEach _allPatches;
{
private _class = configFile >> "CfgVehicles" >> _x;
if (isNull _class) then {
WARNING_1("in units[] but null - %1", _x);
_testPass = false;
} else {
// if (((getNumber (_class >> "scope")) != 2) && {((getNumber (_class >> "scopeCurator")) != 2)}) then {
// WARNING_2("in units[] but not public - %1 from %2", configName _class, configSourceMod _class);
// _testPass = false;
// };
};
} forEach _allUnits;
// Get all weapons[]
private _allWeapons = [];
{
_allWeapons append ((getArray (_x >> "weapons")) apply { toLower _x });
} forEach _allPatches;
{
private _class = configFile >> "CfgWeapons" >> _x;
if (isNull _class) then {
WARNING_1("in weapons[] but null - %1", _x);
_testPass = false;
} else {
// if (((getNumber (_class >> "scope")) != 2) && {((getNumber (_class >> "scopeCurator")) != 2)}) then {
// WARNING_2("in weapons[] but not public - %1 from %2", configName _class, configSourceMod _class);
// _testPass = false;
// };
};
} forEach _allWeapons;
// Check if all public vics are defined in a cfgPatch
private _vics = "(configName _x) select [0,3] == 'ace'" configClasses (configFile >> "CfgVehicles");
{
if (((getNumber (_x >> "scope")) == 2) || {((getNumber (_x >> "scopeCurator")) == 2)}) then {
if (!((toLower configName _x) in _allUnits)) then {
WARNING_2("Not in any units[] - %1 from %2", configName _x, configSourceMod _x);
_testPass = false;
};
};
} forEach _vics;
// Check if all public weapons are defined in a cfgPatch
private _weapons = "(configName _x) select [0,3] == 'ace'" configClasses (configFile >> "CfgWeapons");
{
private _type = toLower configName _x;
if (((getNumber (_x >> "scope")) == 2) || {((getNumber (_x >> "scopeCurator")) == 2)}) then {
if (!((toLower configName _x) in _allWeapons)) then {
WARNING_2("Not in any weapons[] - %1 from %2", configName _x, configSourceMod _x);
_testPass = false;
};
};
} forEach _weapons;
_testPass

View File

@ -14,7 +14,7 @@ private _vehicles = configProperties [configFile >> "CfgVehicles", "(isClass _x)
private _glassesConfig = configFile >> "CfgGlasses" >> _name;
if (((!isClass _weaponConfig) || {(getNumber (_weaponConfig >> "type")) in [1,2,4]}) && {!isClass _glassesConfig}) then {
diag_log text format ["%1 -> TransportItems -> %2 = Bad", _vehType, _name];
_testPass = false;
if ("ace" in toLower (_vehType + _name)) then { _testPass = false; };
};
};
} forEach (configProperties [_x >> "TransportItems", "isClass _x", true]);
@ -23,7 +23,7 @@ private _vehicles = configProperties [configFile >> "CfgVehicles", "(isClass _x)
private _weaponConfig = configFile >> "CfgWeapons" >> _name;
if ((!isClass _weaponConfig) || {!((getNumber (_weaponConfig >> "type")) in [1,2,4])}) then {
diag_log text format ["%1 -> TransportWeapons -> %2 = Bad", _vehType, _name];
_testPass = false;
if ("ace" in toLower (_vehType + _name)) then { _testPass = false; };
};
} forEach (configProperties [_x >> "TransportWeapons", "isClass _x", true]);
{
@ -31,7 +31,7 @@ private _vehicles = configProperties [configFile >> "CfgVehicles", "(isClass _x)
private _magConfig = configFile >> "CfgMagazines" >> _name;
if ((!isClass _magConfig)) then {
diag_log text format ["%1 -> TransportMagazines -> %2 = Bad", _vehType, _name];
_testPass = false;
if ("ace" in toLower (_vehType + _name)) then { _testPass = false; };
};
} forEach (configProperties [_x >> "TransportMagazines", "isClass _x", true]);
{
@ -39,7 +39,7 @@ private _vehicles = configProperties [configFile >> "CfgVehicles", "(isClass _x)
private _vehConfig = configFile >> "CfgVehicles" >> _name;
if ((!isClass _vehConfig)) then {
diag_log text format ["%1 -> TransportBackpacks -> %2 = Bad", _vehType, _name];
_testPass = false;
if ("ace" in toLower (_vehType + _name)) then { _testPass = false; };
};
} forEach (configProperties [_x >> "TransportBackpacks", "isClass _x", true]);
} forEach _vehicles;

View File

@ -3,7 +3,7 @@
class CfgPatches {
class ADDON {
name = COMPONENT_NAME;
units[] = {QGVAR(Sound),QGVAR(Turret_MBT_01),QGVAR(Turret_MBT_02)};
units[] = {};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_common"};

View File

@ -4,8 +4,8 @@
class CfgPatches {
class ADDON {
name = COMPONENT_NAME;
units[] = {};
weapons[] = {"ace_csw_carryTripod", "ace_csw_staticATWeapon"};
units[] = {QGVAR(m3Tripod),QGVAR(m3TripodLow),QGVAR(kordTripod),QGVAR(kordTripodLow),QGVAR(sag30Tripod),QGVAR(m220Tripod),QGVAR(spg9Tripod),QGVAR(mortarBaseplate)};
weapons[] = {QGVAR(m3CarryTripod),QGVAR(m3CarryTripodLow),QGVAR(kordCarryTripod),QGVAR(kordCarryTripodLow),QGVAR(m220CarryTripod),QGVAR(spg9CarryTripod),QGVAR(sag30CarryTripod),QGVAR(carryMortarBaseplate),QGVAR(staticATCarry),QGVAR(staticAACarry),QGVAR(staticHMGCarry),QGVAR(staticM2ShieldCarry),QGVAR(staticGMGCarry),QGVAR(staticMortarCarry)};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_interaction"};
author = ECSTRING(common,ACETeam);

View File

@ -4,7 +4,7 @@ class CfgPatches {
class ADDON {
name = COMPONENT_NAME;
units[] = {};
weapons[] = {"ACE_launch_NLAW_loaded_F","ACE_launch_NLAW_used_F"};
weapons[] = {"ACE_launch_NLAW_ready_F","ACE_launch_NLAW_used_F"};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_common"};
author = ECSTRING(common,ACETeam);

View File

@ -4,7 +4,7 @@ class CfgPatches {
class ADDON {
name = COMPONENT_NAME;
units[] = {"ACE_fastropingSupplyCrate"};
weapons[] = {"ACE_rope12","ACE_rope15","ACE_rope18","ACE_rope27","ACE_rope36"};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_interaction","ace_logistics_rope"};
author = ECSTRING(common,ACETeam);

View File

@ -59,8 +59,8 @@ class CfgVehicles {
editorSubcategory = "EdSubcat_InventoryItems";
vehicleClass = "Items";
class TransportItems {
MACRO_ADDITEM(ACE_Flashlight_Maglite_ML300L,1);
class TransportWeapons {
MACRO_ADDWEAPON(ACE_Flashlight_Maglite_ML300L,1);
};
};
@ -97,7 +97,9 @@ class CfgVehicles {
MACRO_ADDITEM(ACE_Flashlight_MX991,12);
MACRO_ADDITEM(ACE_Flashlight_KSF1,12);
MACRO_ADDITEM(ACE_Flashlight_XL50,12);
MACRO_ADDITEM(ACE_Flashlight_Maglite_ML300L,2);
};
class TransportWeapons {
MACRO_ADDWEAPON(ACE_Flashlight_Maglite_ML300L,2);
};
};
};

View File

@ -2,8 +2,8 @@
class CfgPatches {
class ADDON {
units[] = {};
weapons[] = {};
units[] = {QXGVAR(setupModule), QXGVAR(buildLocationModule)};
weapons[] = {"ACE_Fortify"};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_interaction"};
author = ECSTRING(common,ACETeam);

View File

@ -3,7 +3,7 @@
class CfgPatches {
class ADDON {
name = COMPONENT_NAME;
units[] = {"ACE_HuntIR", "ACE_HuntIRBox"};
units[] = {"ACE_HuntIR", "ACE_HuntIR_Box", "ACE_Item_HuntIR_monitor"};
weapons[] = {"ACE_HuntIR_monitor"};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_common"};

View File

@ -4,7 +4,7 @@ class CfgPatches {
class ADDON {
name = COMPONENT_NAME;
units[] = {};
weapons[] = {};
weapons[] = {"ACE_rope3","ACE_rope6","ACE_rope12","ACE_rope15","ACE_rope18","ACE_rope27","ACE_rope36"};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_common"};
author = ECSTRING(common,ACETeam);

View File

@ -3,7 +3,7 @@
class CfgPatches {
class ADDON {
name = COMPONENT_NAME;
units[] = {};
units[] = {QGVAR(moduleGroupSettings)};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_common"};

View File

@ -4,7 +4,7 @@ class CfgPatches {
class ADDON {
name = COMPONENT_NAME;
units[] = {};
weapons[] = {};
weapons[] = {"ACE_SpareBarrel_Item"};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_interaction"};
author = ECSTRING(common,ACETeam);

View File

@ -158,6 +158,10 @@ class CfgVehicles {
transportAmmo = 0;
GVAR(defaultSupply) = 1200;
};
class Box_IND_AmmoOrd_F;
class Box_IDAP_AmmoOrd_F: Box_IND_AmmoOrd_F {
transportAmmo = 0; // not sure why this one has 240
};
// Dummy Vehicles
class ThingX;

View File

@ -485,6 +485,11 @@ class CfgVehicles {
GVAR(hooks)[] = {{0, 0.4, -0.5}, {0, -0.4, -0.5}};
GVAR(fuelCargo) = REFUEL_INFINITE_FUEL;
};
class Land_FuelStation_03_pump_F: House_F { // Enoch
transportFuel = 0; //50k
GVAR(hooks)[] = {{0, 0.4, -0.5}, {0, -0.4, -0.5}};
GVAR(fuelCargo) = REFUEL_INFINITE_FUEL;
};
// Helper object for non-AllVehicles objects
class GVAR(helper): Helicopter_Base_F {

View File

@ -3,8 +3,8 @@
class CfgPatches {
class ADDON {
name = COMPONENT_NAME;
units[] = {};
weapons[] = {QGVAR(fuelNozzle)};
units[] = {QGVAR(fuelNozzle)};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_interaction"};
author = ECSTRING(common,ACETeam);

View File

@ -3,8 +3,8 @@
class CfgPatches {
class ADDON {
name = COMPONENT_NAME;
units[] = {};
weapons[] = {"ACE_Rallypoint_West", "ACE_Rallypoint_East", "ACE_Rallypoint_Independent", "ACE_Rallypoint_West_Base", "ACE_Rallypoint_East_Base", "ACE_Rallypoint_Independent_Base"};
units[] = {"ACE_Rallypoint_West", "ACE_Rallypoint_East", "ACE_Rallypoint_Independent", "ACE_Rallypoint_West_Base", "ACE_Rallypoint_East_Base", "ACE_Rallypoint_Independent_Base"};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = { "ace_common" };
author = ECSTRING(common,ACETeam);

View File

@ -3,8 +3,8 @@
class CfgPatches {
class ADDON {
name = COMPONENT_NAME;
units[] = {"ACE_Item_Sandbag", "ACE_Item_Sandbag_empty"};
weapons[] = {"ACE_Sandbag", "ACE_Sandbag_empty"};
units[] = {"ACE_Item_Sandbag_empty"};
weapons[] = {"ACE_Sandbag_empty"};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_interaction"};
author = ECSTRING(common,ACETeam);

View File

@ -3,7 +3,7 @@
class CfgPatches {
class ADDON {
name = COMPONENT_NAME;
units[] = {};
units[] = {QGVAR(module)};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_common"};

View File

@ -3,7 +3,7 @@
class CfgPatches {
class ADDON {
name = COMPONENT_NAME;
units[] = {};
units[] = {QGVAR(virtual)};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_common"};

View File

@ -5,7 +5,7 @@ class CfgPatches {
class ADDON {
name = COMPONENT_NAME;
units[] = {};
weapons[] = {};
weapons[] = {QGVAR(2b14_carry), QGVAR(nsv_carry), QGVAR(kord_carry), QGVAR(ags30_carry), QGVAR(spg9_carry), QGVAR(spg9m_carry), QGVAR(metis_carry), QGVAR(kornet_carry)};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_explosives", "ace_csw", "ace_rearm", "ace_refuel", "ace_repair", "rhs_main_loadorder"};
author = ECSTRING(common,ACETeam);

View File

@ -5,7 +5,7 @@ class CfgPatches {
class ADDON {
name = COMPONENT_NAME;
units[] = {};
weapons[] = {};
weapons[] = {QGVAR(dshkm_carry)};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_explosives", "ace_csw", "rhsgref_main_loadorder"};
author = ECSTRING(common,ACETeam);

View File

@ -5,7 +5,7 @@ class CfgPatches {
class ADDON {
name = COMPONENT_NAME;
units[] = {};
weapons[] = {};
weapons[] = {QGVAR(m252_carry), QGVAR(m2_carry), QGVAR(mk19_carry), QGVAR(tow_carry)};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_explosives", "ace_javelin", "ace_rearm", "ace_refuel", "ace_repair", "ace_csw", "rhsusf_main_loadorder"};
author = ECSTRING(common,ACETeam);