From 5a4487f1eae7173d9551d2df9eff7f0ca675aca4 Mon Sep 17 00:00:00 2001 From: commy2 Date: Mon, 17 Feb 2020 01:34:46 +0100 Subject: [PATCH] Medical - fix the Enoch pilot uniform not taking damage, fix hitpoints test (#7527) * fix the medical hitpoints test * fix the Enoch pilot * readd optional test for all units * Run test at preStart Co-authored-by: PabstMirror --- addons/medical/XEH_preStart.sqf | 2 ++ addons/medical/dev/test_hitpointConfigs.sqf | 22 +++++++++++++++------ addons/medical_engine/CfgVehicles.hpp | 8 ++++++++ 3 files changed, 26 insertions(+), 6 deletions(-) diff --git a/addons/medical/XEH_preStart.sqf b/addons/medical/XEH_preStart.sqf index 022888575e..bc3262c38c 100644 --- a/addons/medical/XEH_preStart.sqf +++ b/addons/medical/XEH_preStart.sqf @@ -1,3 +1,5 @@ #include "script_component.hpp" #include "XEH_PREP.hpp" + +[false] call compile preprocessFileLineNumbers QPATHTOF(dev\test_hitpointConfigs.sqf); diff --git a/addons/medical/dev/test_hitpointConfigs.sqf b/addons/medical/dev/test_hitpointConfigs.sqf index 8838b1d744..2067abcd66 100644 --- a/addons/medical/dev/test_hitpointConfigs.sqf +++ b/addons/medical/dev/test_hitpointConfigs.sqf @@ -1,12 +1,22 @@ -// PabstMirror +// PabstMirror, commy2 // ["medicalHitpoints"] call ace_common_fnc_runTests; -// execVM "\z\ace\addons\medical\dev\test_hitpointConfigs.sqf" +// call compile preprocessFileLineNumbers "\z\ace\addons\medical\dev\test_hitpointConfigs.sqf" #include "\z\ace\addons\medical\script_component.hpp" // UAV-AI should get filtered by scope check -private _mans = configProperties [configFile >> "CfgVehicles", "(isClass _x) && {(getNumber (_x >> 'scope')) == 2} && {configName _x isKindOf 'CAManBase'}", true]; -INFO_1("Checking mans for medical hitpoints [%1 mans]",count _mans); + +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; { @@ -22,12 +32,12 @@ private _testPass = true; _testPass = false; }; - if (((_hitpoints findIf {_x == "HitLeftArm"}) == -1) || {(_hitpoints findIf {_x == "HitLeftArm"}) == -1} + if (((_hitpoints findIf {_x == "HitLeftArm"}) == -1) || {(_hitpoints findIf {_x == "HitRightArm"}) == -1} || {(_hitpoints findIf {_x == "HitLeftLeg"}) == -1} || {(_hitpoints findIf {_x == "HitRightLeg"}) == -1} || {(_hitpoints findIf {_x == "HitHead"}) == -1} || {(_hitpoints findIf {_x == "HitBody"}) == -1}) then { WARNING_2("%1 missing ace hitpoints: %2",_typeOf,_hitpoints); _testPass = false; }; -} forEach _mans; +} forEach _units; _testPass diff --git a/addons/medical_engine/CfgVehicles.hpp b/addons/medical_engine/CfgVehicles.hpp index 58a4b47114..b17ca15a98 100644 --- a/addons/medical_engine/CfgVehicles.hpp +++ b/addons/medical_engine/CfgVehicles.hpp @@ -113,4 +113,12 @@ class CfgVehicles { ADD_ACE_HITPOINTS(3,3); }; }; + + // Enoch + class I_E_Man_Base_F; + class I_E_Uniform_01_coveralls_F: I_E_Man_Base_F { + class HitPoints { + ADD_ACE_HITPOINTS(2,2); + }; + }; };