Skip to content

Commit

Permalink
Medical - fix the Enoch pilot uniform not taking damage, fix hitpoint…
Browse files Browse the repository at this point in the history
…s 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 <[email protected]>
  • Loading branch information
commy2 and PabstMirror authored Feb 17, 2020
1 parent 85709d5 commit 5a4487f
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 6 deletions.
2 changes: 2 additions & 0 deletions addons/medical/XEH_preStart.sqf
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include "script_component.hpp"

#include "XEH_PREP.hpp"

[false] call compile preprocessFileLineNumbers QPATHTOF(dev\test_hitpointConfigs.sqf);
22 changes: 16 additions & 6 deletions addons/medical/dev/test_hitpointConfigs.sqf
Original file line number Diff line number Diff line change
@@ -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;
{
Expand All @@ -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
8 changes: 8 additions & 0 deletions addons/medical_engine/CfgVehicles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};
};
};

0 comments on commit 5a4487f

Please sign in to comment.