From dddb34a97d1897fd3e61d6a4f5612285ede49553 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Wed, 19 Jun 2019 23:22:29 -0500 Subject: [PATCH] stash --- addons/medical_engine/CfgVehicles.hpp | 4 ++++ .../medical_engine/functions/fnc_handleDamage.sqf | 15 +++++++++++++-- addons/medical_engine/script_macros_medical.hpp | 4 ++-- .../functions/fnc_enteredStateDeath.sqf | 4 ++-- addons/medical_status/functions/fnc_setDead.sqf | 9 ++++++++- addons/medical_status/script_component.hpp | 6 +++--- 6 files changed, 32 insertions(+), 10 deletions(-) diff --git a/addons/medical_engine/CfgVehicles.hpp b/addons/medical_engine/CfgVehicles.hpp index 3cccea2c3f..b58d94d0d1 100644 --- a/addons/medical_engine/CfgVehicles.hpp +++ b/addons/medical_engine/CfgVehicles.hpp @@ -4,6 +4,10 @@ class CfgVehicles { class CAManBase: Man { // General class HitPoints { + // class HitNeck; + // class HitHead: HitNeck { + // depends = "HitFace max HitNeck max ACE_HDBracket"; + // }; ADD_ACE_HITPOINTS(1,1); }; }; diff --git a/addons/medical_engine/functions/fnc_handleDamage.sqf b/addons/medical_engine/functions/fnc_handleDamage.sqf index 3ff3065471..578d0a38f1 100644 --- a/addons/medical_engine/functions/fnc_handleDamage.sqf +++ b/addons/medical_engine/functions/fnc_handleDamage.sqf @@ -17,6 +17,7 @@ #define HIT_STRUCTURAL QGVAR($#structural) params ["_unit", "_selection", "_damage", "_shooter", "_ammo", "_hitPointIndex", "_instigator", "_hitpoint"]; +diag_log text format ["HD - %1 - %2", diag_frameno, _this]; // HD sometimes triggers for remote units - ignore. if !(local _unit) exitWith {nil}; @@ -137,7 +138,7 @@ if (_hitPoint isEqualTo "ace_hdbracket") exitWith { }; }; }; - + xxx = false; // No wounds for minor damage if (_receivedDamage > 1E-3) then { [QEGVAR(medical,woundReceived), [_unit, _woundedHitPoint, _receivedDamage, _shooter, _ammo]] call CBA_fnc_localEvent; @@ -154,7 +155,17 @@ if (_hitPoint isEqualTo "ace_hdbracket") exitWith { QGVAR($HitLeftArm),QGVAR($HitRightArm),QGVAR($HitLeftLeg),QGVAR($HitRightLeg) ]; - 0 + if (xxx) then { + xxx = nil; + systemChat "9"; + // _unit setHit ["head", 1]; + _unit setDamage [1, true]; + 5 + } else { + xxx = nil; + systemChat "0"; + 0 + }; }; // Drowning doesn't fire the EH for each hitpoint so the "ace_hdbracket" code never runs diff --git a/addons/medical_engine/script_macros_medical.hpp b/addons/medical_engine/script_macros_medical.hpp index a56e357fe1..4d2aa96ee3 100644 --- a/addons/medical_engine/script_macros_medical.hpp +++ b/addons/medical_engine/script_macros_medical.hpp @@ -1,6 +1,6 @@ // #define DEBUG_MODE_FULL -// #define DISABLE_COMPILE_CACHE -// #define ENABLE_PERFORMANCE_COUNTERS +#define DISABLE_COMPILE_CACHE +#define ENABLE_PERFORMANCE_COUNTERS #define ALL_BODY_PARTS ["head", "body", "leftarm", "rightarm", "leftleg", "rightleg"] #define ALL_SELECTIONS ["head", "body", "hand_l", "hand_r", "leg_l", "leg_r"] diff --git a/addons/medical_statemachine/functions/fnc_enteredStateDeath.sqf b/addons/medical_statemachine/functions/fnc_enteredStateDeath.sqf index 21cf465dcd..e6658c154b 100644 --- a/addons/medical_statemachine/functions/fnc_enteredStateDeath.sqf +++ b/addons/medical_statemachine/functions/fnc_enteredStateDeath.sqf @@ -15,7 +15,7 @@ * Public: No */ -[{ +// [{ params ["_unit"]; // TODO: Probably also needs additional logic to deal with edge cases @@ -25,4 +25,4 @@ private _deathReason = _unit getVariable [QGVAR(deathReason), nil]; [_unit, _deathReason] call EFUNC(medical_status,setDead); -}, _this] call CBA_fnc_execNextFrame; +// }, _this] call CBA_fnc_execNextFrame; diff --git a/addons/medical_status/functions/fnc_setDead.sqf b/addons/medical_status/functions/fnc_setDead.sqf index b76ced3ddc..74259fbc42 100644 --- a/addons/medical_status/functions/fnc_setDead.sqf +++ b/addons/medical_status/functions/fnc_setDead.sqf @@ -14,13 +14,20 @@ */ params ["_unit", ["_reason", "unknown"]]; +TRACE_2("setDead",_unit,_reason); // No heart rate or blood pressure to measure when dead _unit setVariable [VAR_HEART_RATE, 0, true]; _unit setVariable [VAR_BLOOD_PRESS, [0, 0], true]; // Kill the unit without changing visual apperance -[_unit, 1] call EFUNC(medical_engine,setStructuralDamage); +if (isNil "xxx") then { + TRACE_1("normal kill",_unit); + [_unit, 1] call EFUNC(medical_engine,setStructuralDamage); + } else { + TRACE_1("normal kill",_unit); + xxx = true; + }; private _lastShooter = _unit getVariable [QEGVAR(medical,lastDamageSource), objNull]; private _lastInstigator = _unit getVariable [QEGVAR(medical,lastInstigator), objNull]; diff --git a/addons/medical_status/script_component.hpp b/addons/medical_status/script_component.hpp index 324fb88078..d0428f6ba4 100644 --- a/addons/medical_status/script_component.hpp +++ b/addons/medical_status/script_component.hpp @@ -2,9 +2,9 @@ #define COMPONENT_BEAUTIFIED Medical Status #include "\z\ace\addons\main\script_mod.hpp" -// #define DEBUG_MODE_FULL -// #define DISABLE_COMPILE_CACHE -// #define ENABLE_PERFORMANCE_COUNTERS +#define DEBUG_MODE_FULL +#define DISABLE_COMPILE_CACHE +#define ENABLE_PERFORMANCE_COUNTERS #ifdef DEBUG_ENABLED_MEDICAL_STATUS #define DEBUG_MODE_FULL