Skip to content

Commit

Permalink
Fix hasStableVitals and GET_BLOOD_PRESSURE calls
Browse files Browse the repository at this point in the history
  • Loading branch information
BlueTheKing committed Aug 21, 2023
1 parent e355481 commit 7cec6bf
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 11 deletions.
4 changes: 3 additions & 1 deletion addons/main/script_macros.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,4 +206,6 @@

// Circulation
#define VAR_INTERNAL_BLEEDING QEGVAR(circulation,internalBleeding)
#define GET_INTERNAL_BLEEDING(unit) (unit getVariable [VAR_INTERNAL_BLEEDING, 0])
#define GET_INTERNAL_BLEEDING(unit) (unit getVariable [VAR_INTERNAL_BLEEDING, 0])

#define GET_BLOOD_PRESSURE(unit) ([unit] call ACEFUNC(medical_status,getBloodPressure))
2 changes: 1 addition & 1 deletion addons/misc/functions/fnc_fullHealLocal.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ _unit setVariable [QACEGVAR(medical,bodyPartDamage), [0,0,0,0,0,0], true];

// wakeup needs to be done after achieving stable vitals, but before manually reseting unconc var
if (_unit getVariable ["ACE_isUnconscious", false]) then {
if (!([_unit] call ACEFUNC(medical_status,hasStableVitals))) then { ERROR_2("fullheal [unit %1][state %2] did not restore stable vitals",_unit,_state); };
if (!([_unit] call FUNC(hasStableVitals))) then { ERROR_2("fullheal [unit %1][state %2] did not restore stable vitals",_unit,_state); };
TRACE_1("Waking up",_unit);
[QACEGVAR(medical,WakeUp), _unit] call CBA_fnc_localEvent;
_state = [_unit, ACEGVAR(medical,STATE_MACHINE)] call CBA_statemachine_fnc_getCurrentState;
Expand Down
2 changes: 1 addition & 1 deletion addons/misc/functions/fnc_hasStableVitals.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ private _cardiacOutput = [_unit] call ACEFUNC(medical_status,getCardiacOutput);
private _bloodLoss = _unit call EFUNC(pharma,getBloodLoss);
if (_bloodLoss > (ACEGVAR(medical,const_bloodLossKnockOutThreshold) * _cardiacOutput / 2)) exitWith { false };

private _bloodPressure = [_unit] call ACEFUNC(medical_status,getBloodPressure);
private _bloodPressure = GET_BLOOD_PRESSURE(_unit);
_bloodPressure params ["_bloodPressureL", "_bloodPressureH"];
if (_bloodPressureL < 50 || {_bloodPressureH < 60}) exitWith { false };

Expand Down
2 changes: 1 addition & 1 deletion addons/misc/functions/fnc_setUnconscious.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ if (_knockOut) then {
KAT_forceWakeup = true;
[{
params [["_unit", objNull]];
if ((alive _unit) && {_unit call ACEFUNC(medical_status,hasStableVitals)}) then {
if ((alive _unit) && {_unit call FUNC(hasStableVitals)}) then {
[QACEGVAR(medical,WakeUp), _unit] call CBA_fnc_localEvent;
KAT_forceWakeup = false;
} else {
Expand Down
4 changes: 2 additions & 2 deletions addons/misc/script_component.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
#define DEBUG_SETTINGS DEBUG_SETTINGS_MISC
#endif

#include "\x\kat\addons\main\script_macros.hpp"
#include "\z\ace\addons\medical_engine\script_macros_medical.hpp"
#include "\z\ace\addons\medical_engine\script_macros_medical.hpp"
#include "\x\kat\addons\main\script_macros.hpp"
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ params ["_medic", "_patient"];
private _sedated = _patient getVariable [QEGVAR(surgery,sedated), false];
if (_sedated) exitWith {};

private _bloodPressure = [_patient] call ACEFUNC(medical_status,getBloodPressure);
private _bloodPressure = GET_BLOOD_PRESSURE(_patient);
_bloodPressureH = _bloodPressure select 1;

if (_bloodPressureH >= 100 && _bloodPressureH <= 140 && (random 100 <= GVAR(carbonateChance)) && {[_patient] call ACEFUNC(medical_status,hasStableVitals)} ) then {
if (_bloodPressureH >= 100 && _bloodPressureH <= 140 && (random 100 <= GVAR(carbonateChance)) && {[_patient] call EFUNC(misc,hasStableVitals)} ) then {
[_patient, false] call ACEFUNC(medical,setUnconscious);
};
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ params ["_medic", "_patient"];

private _pulse = GET_HEART_RATE(_patient);

if (_pulse >= 70 && _pulse <= 100 && (random 100 <= GVAR(reorientationChance)) && {[_patient] call ACEFUNC(medical_status,hasStableVitals)}) then {
if (_pulse >= 70 && _pulse <= 100 && (random 100 <= GVAR(reorientationChance)) && {[_patient] call EFUNC(misc,hasStableVitals)}) then {
[_patient, false] call ACEFUNC(medical,setUnconscious);
_output = LLSTRING(ReorientingSuccess);
[_output, 1.5, _medic] call ACEFUNC(common,displayTextStructured);
Expand Down
4 changes: 2 additions & 2 deletions addons/pharma/script_component.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
#define DEBUG_SETTINGS DEBUG_SETTINGS_PHARMA
#endif

#include "\x\kat\addons\main\script_macros.hpp"
#include "\z\ace\addons\medical_engine\script_macros_medical.hpp"
#include "\z\ace\addons\medical_engine\script_macros_medical.hpp"
#include "\x\kat\addons\main\script_macros.hpp"

0 comments on commit 7cec6bf

Please sign in to comment.