ACE3/addons/medical/dev/test_hitpointConfigs.sqf
commy2 0fd442451f Interaction Menu - fix a crash when loading savegames (#7115)
* fix a crash when loading savegames

* fix a variable name

* optimize

* Put CAManBase actions into seperate bucket

* Apply suggestions from code review

Co-Authored-By: commy2 <commy-2@gmx.de>

* Fast exit for All

* CaManBase

* can't skip mans
2019-08-01 20:52:20 -05:00

34 lines
1.4 KiB
Plaintext

// 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