diff --git a/addons/medical/config.cpp b/addons/medical/config.cpp index e3557fab40..6c93d1e3e8 100644 --- a/addons/medical/config.cpp +++ b/addons/medical/config.cpp @@ -17,3 +17,7 @@ class CfgPatches { #include "ACE_Settings.hpp" #include "CfgEventHandlers.hpp" #include "CfgVehicles.hpp" + +class ACE_Tests { + medicalHitpoints = QPATHTOF(dev\test_hitpointConfigs.sqf); +}; diff --git a/addons/medical/dev/test_hitpointConfigs.sqf b/addons/medical/dev/test_hitpointConfigs.sqf new file mode 100644 index 0000000000..fb65b34669 --- /dev/null +++ b/addons/medical/dev/test_hitpointConfigs.sqf @@ -0,0 +1,33 @@ +// PabstMirror +// ["medicalHitpoints"] call ace_common_fnc_runTests; +// execVM "\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 _testPass = true; +{ + private _typeOf = configName _x; + private _hitpoints = (configProperties [_x >> "HitPoints", "isClass _x", true]) apply {configName _x}; + + // _typeOf createUnit [position player, group player, "z = this"]; + // deleteVehicle z; + + private _lastHitpoint = (_hitpoints param [(count _hitpoints) - 1, "#array"]); + if (_lastHitpoint != "ACE_HDBracket") then { + WARNING_2("%1 has bad last hitpoint: %2",_typeOf,_hitpoints); + _testPass = false; + }; + + if (((_hitpoints findIf {_x == "HitLeftArm"}) == -1) || {(_hitpoints findIf {_x == "HitLeftArm"}) == -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; + +_testPass diff --git a/addons/medical_engine/CfgVehicles.hpp b/addons/medical_engine/CfgVehicles.hpp index 3cccea2c3f..58a4b47114 100644 --- a/addons/medical_engine/CfgVehicles.hpp +++ b/addons/medical_engine/CfgVehicles.hpp @@ -63,6 +63,11 @@ class CfgVehicles { ADD_ACE_HITPOINTS(1,1); }; }; + class B_Protagonist_VR_F: B_Soldier_base_F { + class HitPoints { + ADD_ACE_HITPOINTS(1,1); + }; + }; class O_Soldier_VR_F: O_Soldier_base_F { class HitPoints { ADD_ACE_HITPOINTS(1,1); @@ -73,10 +78,7 @@ class CfgVehicles { ADD_ACE_HITPOINTS(1,1); }; }; - - // Civilians - class C_man_1; - class C_Soldier_VR_F: C_man_1 { + class I_Protagonist_VR_F: I_Soldier_base_F { class HitPoints { ADD_ACE_HITPOINTS(1,1); }; @@ -86,6 +88,19 @@ class CfgVehicles { ADD_ACE_HITPOINTS(1,1); }; }; + class C_man_1; + class C_Protagonist_VR_F: C_man_1 { + class HitPoints { + ADD_ACE_HITPOINTS(1,1); + }; + }; + + // Civilians + class C_Soldier_VR_F: C_man_1 { + class HitPoints { + ADD_ACE_HITPOINTS(1,1); + }; + }; // APEX class O_V_Soldier_Viper_F: O_Soldier_base_F {