Fixed check blood pressure did not always account for tourniquets

This commit is contained in:
ulteq 2016-12-07 11:32:01 +01:00
parent ab7af04530
commit 5db75ac746
3 changed files with 32 additions and 44 deletions

View File

@ -15,4 +15,8 @@
params ["_target", "_bodyPart"];
((_target getVariable [QGVAR(tourniquets), [0,0,0,0,0,0]]) select (ALL_BODY_PARTS find toLower _bodyPart)) > 0
private _index = ALL_BODY_PARTS find toLower _bodyPart;
if (_index < 0) exitWith { false };
((_target getVariable [QGVAR(tourniquets), [0,0,0,0,0,0]]) select _index) > 0

View File

@ -16,51 +16,40 @@
params ["_caller", "_target", "_bodyPart"];
private _bloodPressure = _target call EFUNC(medical,getBloodPressure);
private _bloodPressure = [0, 0];
if (!alive _target) then {
[0,0]
if (alive _target && !([_target, _bodyPart] call EFUNC(medical,hasTourniquetAppliedTo))) then {
_bloodPressure = _target call EFUNC(medical,getBloodPressure);
};
private _bloodPressureOutput = ELSTRING(medical,Check_Bloodpressure_Output_6);
private _logOutPut = ELSTRING(medical,Check_Bloodpressure_NoBloodpressure);
_bloodPressure params ["_bloodPressureLow", "_bloodPressureHigh"];
private _output = "";
private _logOutPut = "";
if (_caller call EFUNC(medical,isMedic)) then {
_output = ELSTRING(medical,Check_Bloodpressure_Output_1);
_logOutPut = format ["%1/%2", round _bloodPressureHigh, round _bloodPressureLow];
} else {
if (_bloodPressureHigh > 20) then {
_output = ELSTRING(medical,Check_Bloodpressure_Output_2);
_logOutPut = ELSTRING(medical,Check_Bloodpressure_Low);
if (_bloodPressureHigh > 100) then {
_output = ELSTRING(medical,Check_Bloodpressure_Output_3);
_logOutPut = ELSTRING(medical,Check_Bloodpressure_Normal);
if (_bloodPressureHigh > 160) then {
_output = ELSTRING(medical,Check_Bloodpressure_Output_4);
_logOutPut = ELSTRING(medical,Check_Bloodpressure_High);
};
};
if (_bloodPressureHigh > 20) then {
if (_caller call EFUNC(medical,isMedic)) then {
_bloodPressureOutput = ELSTRING(medical,Check_Bloodpressure_Output_1);
_logOutPut = format ["%1/%2", round _bloodPressureHigh, round _bloodPressureLow];
} else {
if (random 10 > 3) then {
_output = ELSTRING(medical,Check_Bloodpressure_Output_5);
_logOutPut = ELSTRING(medical,Check_Bloodpressure_NoBloodpressure);
} else {
_output = ELSTRING(medical,Check_Bloodpressure_Output_6);
//Fail to find pressure, no logoutput
if (_bloodPressureHigh > 20) then {
_bloodPressureOutput = ELSTRING(medical,Check_Bloodpressure_Output_2);
_logOutPut = ELSTRING(medical,Check_Bloodpressure_Low);
if (_bloodPressureHigh > 100) then {
_bloodPressureOutput = ELSTRING(medical,Check_Bloodpressure_Output_3);
_logOutPut = ELSTRING(medical,Check_Bloodpressure_Normal);
if (_bloodPressureHigh > 160) then {
_bloodPressureOutput = ELSTRING(medical,Check_Bloodpressure_Output_4);
_logOutPut = ELSTRING(medical,Check_Bloodpressure_High);
};
};
};
};
};
if (toLower _bodyPart in ["lefthand", "righthand"] && {[_unit, _bodyPart] call EFUNC(medical,hasTourniquetAppliedTo)}) then {
_output = ELSTRING(medical,Check_Bloodpressure_Output_6);
_logOutPut = "";
};
[QEGVAR(common,displayTextStructured), [[_output, _target call EFUNC(common,getName), round _bloodPressureHigh, round _bloodPressureLow], 1.75, _caller], _caller] call CBA_fnc_targetEvent;
[QEGVAR(common,displayTextStructured), [[_bloodPressureOutput, _target call EFUNC(common,getName), round _bloodPressureHigh, round _bloodPressureLow], 1.75, _caller], _caller] call CBA_fnc_targetEvent;
if (_logOutPut != "") then {
[_target, "activity", ELSTRING(medical,Check_Bloodpressure_Log), [_caller call EFUNC(common,getName), _logOutPut]] call FUNC(addToLog);

View File

@ -16,10 +16,10 @@
params ["_caller", "_target", "_bodyPart"];
private _heartRate = _target getVariable [QEGVAR(medical,heartRate), 80];
private _heartRate = 0;
if (!alive _target) then {
_heartRate = 0;
if (alive _target && !([_target, _bodyPart] call EFUNC(medical,hasTourniquetAppliedTo))) then {
_heartRate = _target getVariable [QEGVAR(medical,heartRate), 80];
};
private _heartRateOutput = ELSTRING(medical,Check_Pulse_Output_5);
@ -46,11 +46,6 @@ if (_heartRate > 1.0) then {
};
};
if (toLower _bodyPart in ["lefthand", "righthand"] && {[_target, _bodyPart] call EFUNC(medical,hasTourniquetAppliedTo)}) then {
_heartRateOutput = ELSTRING(medical,Check_Pulse_Output_5);
_logOutPut = ELSTRING(medical,Check_Pulse_None);
};
[QEGVAR(common,displayTextStructured), [[_heartRateOutput, _target call EFUNC(common,getName), round _heartRate], 1.5, _caller], _caller] call CBA_fnc_targetEvent;
if (_logOutPut != "") then {