Skip to content

Commit

Permalink
Chemical/Circulation/GUI/Misc/Pharmacy - Apply HEMTT suggestions (#479)
Browse files Browse the repository at this point in the history
**When merged this pull request will:**
- Apply HEMTT suggestions (1.11), and stop it from complaining

### IMPORTANT

- [Development Guidelines](https://ace3.acemod.org/wiki/development/)
are read, understood and applied.
- Title of this PR uses our standard template `Component -
Add|Fix|Improve|Change|Make|Remove {changes}`.
  • Loading branch information
BlueTheKing committed Feb 26, 2024
1 parent 314465d commit e360eb3
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
7 changes: 2 additions & 5 deletions addons/chemical/functions/fnc_getChemDetectorState.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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);
2 changes: 1 addition & 1 deletion addons/chemical/functions/fnc_hasGasmask.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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);
8 changes: 4 additions & 4 deletions addons/circulation/functions/fnc_AEDX_ViewMonitor.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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];
Expand Down Expand Up @@ -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];
Expand Down
4 changes: 2 additions & 2 deletions addons/circulation/functions/fnc_AEDX_VitalsMonitor.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion addons/circulation/functions/fnc_CPRStart.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion addons/gui/functions/fnc_countTreatmentItems.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion addons/misc/functions/fnc_fullHealLocal.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"];

Expand Down

0 comments on commit e360eb3

Please sign in to comment.