Skip to content

Commit

Permalink
Continuous actions done inside vehicles handling
Browse files Browse the repository at this point in the history
  • Loading branch information
BlueTheKing committed Nov 22, 2023
1 parent 402a330 commit 9a9ae86
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
7 changes: 6 additions & 1 deletion addons/airway/functions/fnc_startHeadTurning.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,12 @@ GVAR(headTurn_timeOut) = true;
params ["_args", "_idPFH"];
_args params ["_medic", "_patient", "_notInVehicle"];

if (!(alive _medic) || IS_UNCONSCIOUS(_medic) || (!(IS_UNCONSCIOUS(_patient)) && alive _patient) || !(_patient getVariable [QGVAR(headTurningActive), false]) || dialog || {!(objectParent _medic isEqualTo objectParent _patient) || {_patient distance2D _medic > ACEGVAR(medical_gui,maxDistance)}}) exitWith {
private _patientCondition = (!(IS_UNCONSCIOUS(_patient)) && alive _patient || _patient isEqualTo objNull);
private _medicCondition = (!(alive _medic) || IS_UNCONSCIOUS(_medic) || _medic isEqualTo objNull);
private _vehicleCondition = !(objectParent _medic isEqualTo objectParent _patient);
private _distanceCondition = (_patient distance2D _medic > ACEGVAR(medical_gui,maxDistance));

if (_patientCondition || _medicCondition || !(_patient getVariable [QGVAR(headTurningActive), false]) || dialog || {(!_notInVehicle && _vehicleCondition) || {(_notInVehicle && _distanceCondition)}}) exitWith {
[_idPFH] call CBA_fnc_removePerFrameHandler;

[] call ACEFUNC(interaction,hideMouseHint);
Expand Down
7 changes: 6 additions & 1 deletion addons/breathing/functions/fnc_useBVM.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,12 @@ GVAR(BVM_timeOut) = true;
params ["_args", "_idPFH"];
_args params ["_medic", "_patient", "_pocket", "_useOxygen", "_oxygenOrigin", "_notInVehicle"];

if (!(alive _medic) || IS_UNCONSCIOUS(_medic) || (!(IS_UNCONSCIOUS(_patient)) && alive _patient) || !(_patient getVariable [QGVAR(BVMInUse), false]) || dialog || {!(objectParent _medic isEqualTo objectParent _patient) || {_patient distance2D _medic > ACEGVAR(medical_gui,maxDistance)}}) exitWith {
private _patientCondition = (!(IS_UNCONSCIOUS(_patient)) && alive _patient || _patient isEqualTo objNull);
private _medicCondition = (!(alive _medic) || IS_UNCONSCIOUS(_medic) || _medic isEqualTo objNull);
private _vehicleCondition = !(objectParent _medic isEqualTo objectParent _patient);
private _distanceCondition = (_patient distance2D _medic > ACEGVAR(medical_gui,maxDistance));

if (_patientCondition || _medicCondition || !(_patient getVariable [QGVAR(BVMInUse), false]) || dialog || {(!_notInVehicle && _vehicleCondition) || {(_notInVehicle && _distanceCondition)}}) exitWith {
[_idPFH] call CBA_fnc_removePerFrameHandler;

_patient setVariable [QGVAR(BVMInUse), false, true];
Expand Down
7 changes: 6 additions & 1 deletion addons/circulation/functions/fnc_CPRStart.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,12 @@ if (_notInVehicle) then {
params ["_args", "_idPFH"];
_args params ["_medic", "_patient", "_notInVehicle", "_CPRStartTime"];

if (_patient isEqualTo objNull || _medic isEqualTo objNull || !(alive _medic) || IS_UNCONSCIOUS(_medic) || (!(IS_UNCONSCIOUS(_patient)) && alive _patient) || (_patient getVariable [QACEGVAR(medical,CPR_provider), objNull]) isEqualTo objNull || !(_medic getVariable [QGVAR(isPerformingCPR), false]) || dialog || {!(objectParent _medic isEqualTo objectParent _patient) || {_patient distance _medic > ACEGVAR(medical_gui,maxDistance)}}) exitWith { // Stop CPR
private _patientCondition = (!(IS_UNCONSCIOUS(_patient)) && alive _patient || _patient isEqualTo objNull);
private _medicCondition = (!(alive _medic) || IS_UNCONSCIOUS(_medic) || _medic isEqualTo objNull);
private _vehicleCondition = !(objectParent _medic isEqualTo objectParent _patient);
private _distanceCondition = (_patient distance2D _medic > ACEGVAR(medical_gui,maxDistance));

if (_patientCondition || _medicCondition || (_patient getVariable [QACEGVAR(medical,CPR_provider), objNull]) isEqualTo objNull || !(_medic getVariable [QGVAR(isPerformingCPR), false]) || dialog || {(!_notInVehicle && _vehicleCondition) || {(_notInVehicle && _distanceCondition)}}) exitWith { // Stop CPR
[_idPFH] call CBA_fnc_removePerFrameHandler;

_medic setVariable [QGVAR(isPerformingCPR), false, true];
Expand Down

0 comments on commit 9a9ae86

Please sign in to comment.