2020-02-17 00:34:46 +00:00
|
|
|
// PabstMirror, commy2
|
2019-07-12 15:03:22 +00:00
|
|
|
// ["medicalHitpoints"] call ace_common_fnc_runTests;
|
2020-02-17 00:34:46 +00:00
|
|
|
// call compile preprocessFileLineNumbers "\z\ace\addons\medical\dev\test_hitpointConfigs.sqf"
|
2019-07-12 15:03:22 +00:00
|
|
|
|
2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2019-07-12 15:03:22 +00:00
|
|
|
|
|
|
|
// UAV-AI should get filtered by scope check
|
2020-02-17 00:34:46 +00:00
|
|
|
|
|
|
|
private _cfgWeapons = configFile >> "CfgWeapons";
|
|
|
|
private _cfgVehicles = configFile >> "CfgVehicles";
|
|
|
|
|
|
|
|
private _uniforms = "getNumber (_x >> 'scope') == 2 && {configName _x isKindOf ['Uniform_Base', _cfgWeapons]}" configClasses _cfgWeapons;
|
|
|
|
private _units = _uniforms apply {_cfgVehicles >> getText (_x >> "ItemInfo" >> "uniformClass")};
|
|
|
|
if (param [0, false]) then { // Check all units (if naked)
|
|
|
|
INFO("checking ALL units");
|
|
|
|
_units append ((configProperties [configFile >> "CfgVehicles", "(isClass _x) && {(getNumber (_x >> 'scope')) == 2} && {configName _x isKindOf 'CAManBase'}", true]));
|
|
|
|
};
|
|
|
|
|
|
|
|
INFO_1("Checking uniforms for correct medical hitpoints [%1 units]",count _units);
|
2019-07-12 15:03:22 +00:00
|
|
|
|
|
|
|
private _testPass = true;
|
|
|
|
{
|
|
|
|
private _typeOf = configName _x;
|
2024-06-11 14:11:28 +00:00
|
|
|
private _hitpoints = (configProperties [_x >> "HitPoints", "isClass _x", true]) apply {toLowerANSI configName _x};
|
|
|
|
private _expectedHitPoints = ["hitleftarm","hitrightarm","hitleftleg","hitrightleg","hithead","hitbody"];
|
|
|
|
private _missingHitPoints = _expectedHitPoints select {!(_x in _hitpoints)};
|
|
|
|
if (_missingHitPoints isNotEqualTo []) then {
|
|
|
|
WARNING_3("%1 missing ace hitpoints: %2 - class hitpoints: %3",_typeOf,_missingHitPoints,_hitpoints);
|
2019-07-12 15:03:22 +00:00
|
|
|
_testPass = false;
|
|
|
|
};
|
|
|
|
|
2024-06-11 14:11:28 +00:00
|
|
|
// _typeOf createUnit [position player, group player, "z = this"];
|
|
|
|
// deleteVehicle z;
|
2020-02-17 00:34:46 +00:00
|
|
|
} forEach _units;
|
2019-07-12 15:03:22 +00:00
|
|
|
|
|
|
|
_testPass
|