Skip to content

Commit

Permalink
Medical - Fix hitpoints on VR units (#7098)
Browse files Browse the repository at this point in the history
  • Loading branch information
PabstMirror authored Jul 12, 2019
1 parent 5b05c59 commit 0c47d45
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 4 deletions.
4 changes: 4 additions & 0 deletions addons/medical/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};
33 changes: 33 additions & 0 deletions addons/medical/dev/test_hitpointConfigs.sqf
Original file line number Diff line number Diff line change
@@ -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
23 changes: 19 additions & 4 deletions addons/medical_engine/CfgVehicles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
};
Expand All @@ -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 {
Expand Down

0 comments on commit 0c47d45

Please sign in to comment.