mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Fix various bugs (#6523)
* Fix medical menu not reopening regardless of setting * Ensure no heartrate or bloodpressure on death * Fix status variables not being reset on respawn * Fix JIP resetting status variables for all units * Fix heart rate adjustment overflow and
This commit is contained in:
parent
0e8ed5315e
commit
5fbaf426a8
@ -97,7 +97,7 @@ private _entries = [ACE_player, GVAR(INTERACTION_TARGET), _name] call FUNC(getTr
|
||||
private _ctrl = (_display displayCtrl (START_IDC + _forEachIndex));
|
||||
if (!(_forEachIndex > AMOUNT_OF_ENTRIES)) then {
|
||||
_ctrl ctrlSetText (_x select 0);
|
||||
private _code = format ["ace_medical_menu_pendingReopen = true; call %1;", (_x select 3)];
|
||||
private _code = format ["ace_medical_gui_pendingReopen = true; call %1;", (_x select 3)];
|
||||
_ctrl ctrlSetEventHandler ["ButtonClick", _code];
|
||||
_ctrl ctrlSetTooltip (_x select 0); // TODO implement
|
||||
_ctrl ctrlShow true;
|
||||
|
@ -14,4 +14,4 @@
|
||||
|
||||
params ["_unit"];
|
||||
|
||||
(GVAR(fatalInjuryCondition) < 2) && {!(_unit getVariable [QGVAR(deathBlocked), false])}
|
||||
(GVAR(fatalInjuryCondition) < 2) && {!(_unit getVariable [QEGVAR(medical,deathBlocked), false])}
|
||||
|
@ -19,4 +19,7 @@ params ["_unit"];
|
||||
// Send a local event before death
|
||||
[QEGVAR(medical,death), [_unit]] call CBA_fnc_localEvent;
|
||||
|
||||
_unit setVariable [VAR_HEART_RATE, 0, true];
|
||||
_unit setVariable [VAR_BLOOD_PRESS, [0, 0], true];
|
||||
|
||||
_unit setDamage 1;
|
||||
|
@ -19,6 +19,7 @@ class Extended_PostInit_EventHandlers {
|
||||
class Extended_Init_EventHandlers {
|
||||
class CAManBase {
|
||||
class ADDON {
|
||||
onRespawn = 1;
|
||||
init = QUOTE(call FUNC(initUnit));
|
||||
};
|
||||
};
|
||||
|
@ -17,6 +17,8 @@
|
||||
|
||||
params ["_unit"];
|
||||
|
||||
if (!local _unit) exitWith {};
|
||||
|
||||
if (damage _unit > 0) then {
|
||||
_unit setDamage 0;
|
||||
};
|
||||
|
@ -46,6 +46,7 @@ private _heartRate = GET_HEART_RATE(_unit);
|
||||
|
||||
if !IN_CRDC_ARRST(_unit) then {
|
||||
private _hrChange = 0;
|
||||
private _targetHR = 0;
|
||||
private _bloodVolume = GET_BLOOD_VOLUME(_unit);
|
||||
if (_bloodVolume > BLOOD_VOLUME_CLASS_4_HEMORRHAGE) then {
|
||||
GET_BLOOD_PRESSURE(_unit) params ["_bloodPressureL", "_bloodPressureH"];
|
||||
@ -57,23 +58,26 @@ if !IN_CRDC_ARRST(_unit) then {
|
||||
_targetBP = _targetBP * (_bloodVolume / DEFAULT_BLOOD_VOLUME);
|
||||
};
|
||||
|
||||
private _targetHR = DEFAULT_HEART_RATE;
|
||||
_targetHR = DEFAULT_HEART_RATE;
|
||||
if (_bloodVolume < BLOOD_VOLUME_CLASS_2_HEMORRHAGE) then {
|
||||
_targetHR = _heartRate * (_targetBP / (45 max _meanBP));
|
||||
};
|
||||
if (_painLevel > 0.2) then {
|
||||
_targetHR = _targetHR max (80 + 50 * _painLevel);
|
||||
};
|
||||
_targetHR = _targetHR + _hrTargetAdjustment;
|
||||
_targetHR = (_targetHR + _hrTargetAdjustment) max 0;
|
||||
|
||||
_hrChange = round(_targetHR - _heartRate) / 2;
|
||||
} else {
|
||||
_hrChange = -round(_heartRate / 10);
|
||||
};
|
||||
_heartRate = (_heartRate + _deltaT * _hrChange) max 0;
|
||||
if (_hrChange < 0) then {
|
||||
_heartRate = (_heartRate + _deltaT * _hrChange) max _targetHR;
|
||||
} else {
|
||||
_heartRate = (_heartRate + _deltaT * _hrChange) min _targetHR;
|
||||
};
|
||||
};
|
||||
|
||||
_unit setVariable [VAR_HEART_RATE, _heartRate, _syncValue];
|
||||
|
||||
_heartRate
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user