ACE3/addons/medical/dev/test_hitpointConfigs.sqf
Grim a85074a797
Medical Engine - Remove ACE_HDBracket hitpoint (#9732)
* Medical Engine - Remove ACE_HDBracket hitpoint

* skip context 4

* move checks to vars

* skip uav/logic entities

* add check for arm/leg hitpoints

* Update addons/medical_engine/functions/fnc_handleDamage.sqf

Co-authored-by: Jouni Järvinen <rautamiekka@users.noreply.github.com>

* don't skip context 2

* clearer custom hitpoint array name

* reenable compile cache

* remove debug mode

* lazy eval

* whitespace

* update comment

* Update fnc_handleDamage.sqf header

* Update addons/medical_engine/functions/fnc_handleDamage.sqf

Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>

* Update addons/medical_engine/XEH_postInit.sqf

Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>

* update hitpoint test

* missing "

* Update addons/medical/dev/test_hitpointConfigs.sqf

Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>

---------

Co-authored-by: Jouni Järvinen <rautamiekka@users.noreply.github.com>
Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>
2024-06-11 11:11:28 -03:00

37 lines
1.6 KiB
Plaintext

// PabstMirror, commy2
// ["medicalHitpoints"] call ace_common_fnc_runTests;
// call compile preprocessFileLineNumbers "\z\ace\addons\medical\dev\test_hitpointConfigs.sqf"
#include "..\script_component.hpp"
// UAV-AI should get filtered by scope check
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);
private _testPass = true;
{
private _typeOf = configName _x;
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);
_testPass = false;
};
// _typeOf createUnit [position player, group player, "z = this"];
// deleteVehicle z;
} forEach _units;
_testPass