From 7dcc50b0424f306ea7b078e1467dd223febdcae7 Mon Sep 17 00:00:00 2001 From: Blue Date: Mon, 12 Feb 2024 21:30:59 +0100 Subject: [PATCH] Apply hemtt suggestions --- .../chemical/functions/fnc_clearChemicalInjuriesLocal.sqf | 2 +- addons/chemical/functions/fnc_getChemDetectorState.sqf | 7 ++----- addons/chemical/functions/fnc_hasGasmask.sqf | 2 +- addons/circulation/functions/fnc_AEDX_ViewMonitor.sqf | 8 ++++---- addons/circulation/functions/fnc_AEDX_VitalsMonitor.sqf | 4 ++-- addons/circulation/functions/fnc_CPRStart.sqf | 2 +- addons/gui/functions/fnc_countTreatmentItems.sqf | 2 +- addons/misc/functions/fnc_fullHealLocal.sqf | 2 +- .../pharma/functions/fnc_treatmentAdvanced_FlushLocal.sqf | 2 +- 9 files changed, 14 insertions(+), 17 deletions(-) diff --git a/addons/chemical/functions/fnc_clearChemicalInjuriesLocal.sqf b/addons/chemical/functions/fnc_clearChemicalInjuriesLocal.sqf index c238c6f80..8083c27d0 100644 --- a/addons/chemical/functions/fnc_clearChemicalInjuriesLocal.sqf +++ b/addons/chemical/functions/fnc_clearChemicalInjuriesLocal.sqf @@ -25,6 +25,6 @@ _unit setVariable [QEGVAR(chemical,isTreated), true, true]; _unit setVariable [QEGVAR(chemical,CS), false, true]; _unit setVariable [QEGVAR(chemical,timeleft), missionNamespace getVariable [QEGVAR(chemical,infectionTime), 60], true]; -if (_unit getVariable [QEGVAR(chemical, painEffect), 0] != 0) then { +if (_unit getVariable [QEGVAR(chemical,painEffect), 0] != 0) then { KAT_PAIN_EFFECT ppEffectEnable false; }; diff --git a/addons/chemical/functions/fnc_getChemDetectorState.sqf b/addons/chemical/functions/fnc_getChemDetectorState.sqf index 1330abc7c..078cb7447 100644 --- a/addons/chemical/functions/fnc_getChemDetectorState.sqf +++ b/addons/chemical/functions/fnc_getChemDetectorState.sqf @@ -17,8 +17,5 @@ params ["_unit", "_isOnOff"]; private _currentState = _unit getVariable [QGVAR(chemDetectorState), false]; -if ("ChemicalDetector_01_watch_F" in (assigneditems _unit) && _currentState == _isOnOff) then { - true -} else { - false -}; + +[false, true] select ("ChemicalDetector_01_watch_F" in (assigneditems _unit) && _currentState == _isOnOff); \ No newline at end of file diff --git a/addons/chemical/functions/fnc_hasGasmask.sqf b/addons/chemical/functions/fnc_hasGasmask.sqf index f363bf8e7..accbbee02 100644 --- a/addons/chemical/functions/fnc_hasGasmask.sqf +++ b/addons/chemical/functions/fnc_hasGasmask.sqf @@ -26,4 +26,4 @@ private _patientarr = _patient call ACEFUNC(common,uniqueItems); private _patienthasGasmask = false; { if(_x in (missionNamespace getVariable [QGVAR(availGasmaskList), []])) then {_patienthasGasmask = true} } forEach _patientarr; -if (!_playerhasGasmask && !_patienthasGasmask) then { false } else { true } +[true, false] select (!_playerhasGasmask && !_patienthasGasmask); \ No newline at end of file diff --git a/addons/circulation/functions/fnc_AEDX_ViewMonitor.sqf b/addons/circulation/functions/fnc_AEDX_ViewMonitor.sqf index 468445765..a45de5552 100644 --- a/addons/circulation/functions/fnc_AEDX_ViewMonitor.sqf +++ b/addons/circulation/functions/fnc_AEDX_ViewMonitor.sqf @@ -140,8 +140,8 @@ GVAR(PulseRateReady) = true; // Handle date and time display - [year,month,day,hour,min] - ctrlSetText [IDC_DISPLAY_DATEANDTIME, format ["%1/%2/%3 %4:%5", (if (date select 2 < 10) then { "0" } else { "" }) + str (date select 2), (if (date select 1 < 10) then { "0" } else { "" }) + str (date select 1), date select 0, (if (date select 3 < 10) then { "0" } else { "" }) + str (date select 3), (if (date select 4 < 10) then { "0" } else { "" }) + str (date select 4)]]; - ctrlSetText [IDC_DISPLAY_ELAPSEDTIME, format ["%1:%2:%3", (if ((floor(time/3600)) < 10) then { "0" } else { "" }) + str (floor(time/3600)), (if ((floor(((time/3600) - floor(time/3600)) * 60)) < 10) then { "0" } else { "" }) + str (floor(((time/3600) - floor(time/3600)) * 60)), (if ((floor(((time/60) - floor(time/60)) * 60)) < 10) then { "0" } else { "" }) + str (floor(((time/60) - floor(time/60)) * 60))]]; + ctrlSetText [IDC_DISPLAY_DATEANDTIME, format ["%1/%2/%3 %4:%5", (["", "0"] select (date select 2 < 10)) + str (date select 2), (["", "0"] select (date select 1 < 10)) + str (date select 1), date select 0, (["", "0"] select (date select 3 < 10)) + str (date select 3), (["", "0"] select (date select 4 < 10)) + str (date select 4)]]; + ctrlSetText [IDC_DISPLAY_ELAPSEDTIME, format ["%1:%2:%3", (["", "0"] select (floor time / 3600 < 10)) + str (floor(time/3600)), (["", "0"] select (floor time / 3600 - floor time / 3600 * 60 < 10)) + str (floor(((time/3600) - floor(time/3600)) * 60)), (["", "0"] select (floor time / 60 - floor time / 60 * 60 < 10)) + str (floor(((time/60) - floor(time/60)) * 60))]]; if (GVAR(AEDX_MonitorTarget) getVariable [QGVAR(AED_X_VitalsMonitor_Connected), false]) then { private _partIndex = ((GVAR(AEDX_MonitorTarget) getVariable [QGVAR(AED_X_VitalsMonitor_Provider), [-1, -1, -1]]) select 2); @@ -153,7 +153,7 @@ GVAR(PulseRateReady) = true; private _PRBar = _dlg displayCtrl IDC_DISPLAY_PULSERATEBAR; - if (!(HAS_TOURNIQUET_APPLIED_ON(GVAR(AEDX_MonitorTarget), _partIndex))) then { + if (!(HAS_TOURNIQUET_APPLIED_ON(GVAR(AEDX_MonitorTarget),_partIndex))) then { if (GVAR(PulseRateReady)) then { GVAR(PulseRateReady) = false; private _pr = GVAR(AEDX_MonitorTarget) getVariable [QACEGVAR(medical,heartRate), 0]; @@ -274,7 +274,7 @@ GVAR(PulseRateReady) = true; private _partIndex = ((GVAR(AEDX_MonitorTarget) getVariable [QGVAR(AED_X_VitalsMonitor_Provider), [-1, -1, -1]]) select 2); - if (HAS_TOURNIQUET_APPLIED_ON(GVAR(AEDX_MonitorTarget), _partIndex)) then { + if (HAS_TOURNIQUET_APPLIED_ON(GVAR(AEDX_MonitorTarget),_partIndex)) then { _bp = [0,0]; } else { _spO2 = GVAR(AEDX_MonitorTarget) getVariable [QEGVAR(breathing,airwayStatus), 100]; diff --git a/addons/circulation/functions/fnc_AEDX_VitalsMonitor.sqf b/addons/circulation/functions/fnc_AEDX_VitalsMonitor.sqf index 90e8b14cd..f1ca9d62e 100644 --- a/addons/circulation/functions/fnc_AEDX_VitalsMonitor.sqf +++ b/addons/circulation/functions/fnc_AEDX_VitalsMonitor.sqf @@ -49,7 +49,7 @@ if (_patient getVariable ["kat_AEDXPatient_PFH", -1] isEqualTo -1) then { [_patient, "quick_view", LSTRING(VitalsMonitor_VMActive_StatusLog)] call FUNC(removeLog); private _partIndex = ((_patient getVariable [QGVAR(AED_X_VitalsMonitor_Provider), [objNull, -1, 3]]) select 2); - private _tourniquetApplied = HAS_TOURNIQUET_APPLIED_ON(_patient, _partIndex); + private _tourniquetApplied = HAS_TOURNIQUET_APPLIED_ON(_patient,_partIndex); private _hr = 0; private _pr = 0; @@ -270,7 +270,7 @@ if (_patient getVariable [QGVAR(AED_X_VitalsMonitor_Connected), false] && {(_pat }; private _partIndex = ((_patient getVariable [QGVAR(AED_X_VitalsMonitor_Provider), [-1, -1, -1]]) select 2); - private _tourniquetApplied = HAS_TOURNIQUET_APPLIED_ON(_patient, _partIndex); + private _tourniquetApplied = HAS_TOURNIQUET_APPLIED_ON(_patient,_partIndex); if (_patient getVariable [QGVAR(DefibrillatorInUse), false] || !(_patient getVariable [QGVAR(AED_X_VitalsMonitor_VolumePatient), false])) then { } else { diff --git a/addons/circulation/functions/fnc_CPRStart.sqf b/addons/circulation/functions/fnc_CPRStart.sqf index 00d68bfc8..4d983776f 100644 --- a/addons/circulation/functions/fnc_CPRStart.sqf +++ b/addons/circulation/functions/fnc_CPRStart.sqf @@ -81,7 +81,7 @@ if (_notInVehicle) then { // Format time to minutes:seconds private _CPRTime = CBA_missionTime - _CPRStartTime; - private _time = format ["%1:%2",(if ((floor(((_CPRTime/3600) - floor(_CPRTime/3600)) * 60)) < 10) then { "0" } else { "" }) + str (floor(((_CPRTime/3600) - floor(_CPRTime/3600)) * 60)), (if ((floor(((_CPRTime/60) - floor(_CPRTime/60)) * 60)) < 10) then { "0" } else { "" }) + str (floor(((_CPRTime/60) - floor(_CPRTime/60)) * 60))]; + private _time = format ["%1:%2",(["", "0"] select (floor _CPRTime / 3600 - floor _CPRTime / 3600 * 60 < 10)) + str (floor(((_CPRTime/3600) - floor(_CPRTime/3600)) * 60)), (["", "0"] select (floor _CPRTime / 60 - floor _CPRTime / 60 * 60 < 10)) + str (floor(((_CPRTime/60) - floor(_CPRTime/60)) * 60))]; [_patient, "activity", LSTRING(Activity_CPR), [[_medic, false, true] call ACEFUNC(common,getName), _time]] call ACEFUNC(medical_treatment,addToLog); diff --git a/addons/gui/functions/fnc_countTreatmentItems.sqf b/addons/gui/functions/fnc_countTreatmentItems.sqf index 21b74f62d..d48bfca45 100644 --- a/addons/gui/functions/fnc_countTreatmentItems.sqf +++ b/addons/gui/functions/fnc_countTreatmentItems.sqf @@ -39,7 +39,7 @@ if (ACE_player != ACEGVAR(medical_gui,target)) then { // Vehicle private _medicVehicle = objectParent ACE_player; private _patientVehicle = objectParent ACEGVAR(medical_gui,target); -private _vehicle = if !(isNull _medicVehicle) then {_medicVehicle} else {_patientVehicle}; +private _vehicle = ([_patientVehicle, _medicVehicle] select (!isNull _medicVehicle)); if !(isNull _vehicle) then { _vehicleCount = 0; diff --git a/addons/misc/functions/fnc_fullHealLocal.sqf b/addons/misc/functions/fnc_fullHealLocal.sqf index 878689301..099693c6e 100644 --- a/addons/misc/functions/fnc_fullHealLocal.sqf +++ b/addons/misc/functions/fnc_fullHealLocal.sqf @@ -47,7 +47,7 @@ _unit setVariable [QEGVAR(chemical,airPoisoning), false, true]; _unit setVariable [QEGVAR(chemical,isTreated) ,true,true]; _unit setVariable [QEGVAR(chemical,CS), false, true]; _unit setVariable [QEGVAR(chemical,timeleft), missionNamespace getVariable [QEGVAR(chemical,infectionTime), 60], true]; -if (_unit getVariable [QEGVAR(chemical, painEffect), 0] != 0) then { +if (_unit getVariable [QEGVAR(chemical,painEffect), 0] != 0) then { KAT_PAIN_EFFECT ppEffectEnable false; }; diff --git a/addons/pharma/functions/fnc_treatmentAdvanced_FlushLocal.sqf b/addons/pharma/functions/fnc_treatmentAdvanced_FlushLocal.sqf index 7892edbbf..5ffaf00f9 100644 --- a/addons/pharma/functions/fnc_treatmentAdvanced_FlushLocal.sqf +++ b/addons/pharma/functions/fnc_treatmentAdvanced_FlushLocal.sqf @@ -32,7 +32,7 @@ private _occludedFlushed = false; [_patient, "activity", LLSTRING(flush_log), [[_medic] call ACEFUNC(common,getName)]] call ACEFUNC(medical_treatment,addToLog); -if !(HAS_TOURNIQUET_APPLIED_ON(_patient, _partIndex)) then { +if !(HAS_TOURNIQUET_APPLIED_ON(_patient,_partIndex)) then { { _x params ["_partIndexN", "_medication"];