Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chemical/Circulation/Watch - Fix Testing Errors #665

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion addons/chemical/functions/fnc_poison.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ if (_gasLevel == 0) exitWith {
};

// We assume that oxygen masks only cover the mouth and nose, leaving the eyes exposed to CS gas
if ((_unit getVariable [QEGVAR(breathing,oxygenMaskActive)])) exitWith {
if ((_unit getVariable [QEGVAR(breathing,oxygenMaskActive), false])) exitWith {
TRACE_1("unit has oxygen mask",_unit);
};

Expand Down
84 changes: 78 additions & 6 deletions addons/circulation/CfgVehicles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,15 @@ class CfgVehicles {

class LandVehicle;
class Car: LandVehicle {
class ACE_SelfActions {
class KAT_ArterialTest {
displayName = CSTRING(Arterial_Test_Action);
condition = QUOTE(_target call ACEFUNC(medical_treatment,isMedicalVehicle));
statement = "";
insertChildren = QUOTE([ARR_2(_target,_player)] call FUNC(addArterialTestActions));
icon = QACEPATHTOF(medical_gui,ui\cross.paa);
};
};
class ACE_Actions {
class ACE_MainActions {
class KAT_ArterialTest {
Expand All @@ -250,6 +259,15 @@ class CfgVehicles {

class Car_F: Car {};
class Quadbike_01_base_F: Car_F {
class ACE_SelfActions {
class KAT_ArterialTest {
displayName = CSTRING(Arterial_Test_Action);
condition = QUOTE(_target call ACEFUNC(medical_treatment,isMedicalVehicle));
statement = "";
insertChildren = QUOTE([ARR_2(_target,_player)] call FUNC(addArterialTestActions));
icon = QACEPATHTOF(medical_gui,ui\cross.paa);
};
};
class ACE_Actions: ACE_Actions {
class ACE_MainActions: ACE_MainActions {
class KAT_ArterialTest {
Expand All @@ -264,6 +282,15 @@ class CfgVehicles {
};

class Kart_01_Base_F: Car_F {
class ACE_SelfActions {
class KAT_ArterialTest {
displayName = CSTRING(Arterial_Test_Action);
condition = QUOTE(_target call ACEFUNC(medical_treatment,isMedicalVehicle));
statement = "";
insertChildren = QUOTE([ARR_2(_target,_player)] call FUNC(addArterialTestActions));
icon = QACEPATHTOF(medical_gui,ui\cross.paa);
};
};
class ACE_Actions: ACE_Actions {
class ACE_MainActions: ACE_MainActions {
class KAT_ArterialTest {
Expand All @@ -278,6 +305,15 @@ class CfgVehicles {
};

class Tank: LandVehicle {
class ACE_SelfActions {
class KAT_ArterialTest {
displayName = CSTRING(Arterial_Test_Action);
condition = QUOTE(_target call ACEFUNC(medical_treatment,isMedicalVehicle));
statement = "";
insertChildren = QUOTE([ARR_2(_target,_player)] call FUNC(addArterialTestActions));
icon = QACEPATHTOF(medical_gui,ui\cross.paa);
};
};
class ACE_Actions {
class ACE_MainActions {
class KAT_ArterialTest {
Expand All @@ -292,6 +328,15 @@ class CfgVehicles {
};

class Motorcycle: LandVehicle {
class ACE_SelfActions {
class KAT_ArterialTest {
displayName = CSTRING(Arterial_Test_Action);
condition = QUOTE(_target call ACEFUNC(medical_treatment,isMedicalVehicle));
statement = "";
insertChildren = QUOTE([ARR_2(_target,_player)] call FUNC(addArterialTestActions));
icon = QACEPATHTOF(medical_gui,ui\cross.paa);
};
};
class ACE_Actions {
class ACE_MainActions {
class KAT_ArterialTest {
Expand All @@ -307,6 +352,15 @@ class CfgVehicles {

class Air;
class Helicopter: Air {
class ACE_SelfActions {
class KAT_ArterialTest {
displayName = CSTRING(Arterial_Test_Action);
condition = QUOTE(_target call ACEFUNC(medical_treatment,isMedicalVehicle));
statement = "";
insertChildren = QUOTE([ARR_2(_target,_player)] call FUNC(addArterialTestActions));
icon = QACEPATHTOF(medical_gui,ui\cross.paa);
};
};
class ACE_Actions {
class ACE_MainActions {
class KAT_ArterialTest {
Expand All @@ -321,6 +375,15 @@ class CfgVehicles {
};

class Plane: Air {
class ACE_SelfActions {
class KAT_ArterialTest {
displayName = CSTRING(Arterial_Test_Action);
condition = QUOTE(_target call ACEFUNC(medical_treatment,isMedicalVehicle));
statement = "";
insertChildren = QUOTE([ARR_2(_target,_player)] call FUNC(addArterialTestActions));
icon = QACEPATHTOF(medical_gui,ui\cross.paa);
};
};
class ACE_Actions {
class ACE_MainActions {
class KAT_ArterialTest {
Expand All @@ -336,6 +399,15 @@ class CfgVehicles {

class Ship;
class Ship_F: Ship {
class ACE_SelfActions {
class KAT_ArterialTest {
displayName = CSTRING(Arterial_Test_Action);
condition = QUOTE(_target call ACEFUNC(medical_treatment,isMedicalVehicle));
statement = "";
insertChildren = QUOTE([ARR_2(_target,_player)] call FUNC(addArterialTestActions));
icon = QACEPATHTOF(medical_gui,ui\cross.paa);
};
};
class ACE_Actions {
class ACE_MainActions {
class KAT_ArterialTest {
Expand All @@ -354,12 +426,12 @@ class CfgVehicles {
class ACE_Actions {
class ACE_MainActions {
class KAT_ApplyBloodTest {
displayName = CSTRING(Arterial_Test);
condition = "true";
statement = "true";
insertChildren = QUOTE([ARR_2(_target,_player)] call FUNC(addArterialApplyActions));
icon = QACEPATHTOF(medical_gui,ui\cross.paa);
};
displayName = CSTRING(Arterial_Test);
condition = QUOTE(GVAR(abgEnable));
statement = "true";
insertChildren = QUOTE([ARR_2(_target,_player)] call FUNC(addArterialApplyActions));
icon = QACEPATHTOF(medical_gui,ui\cross.paa);
};
};
class ACE_Head {
class CheckBloodPressure {}; // Remove the ability to check blood pressure at the head
Expand Down
10 changes: 5 additions & 5 deletions addons/circulation/functions/fnc_addArterialApplyActions.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ private _fnc_getActions = {

if (_idNumber > 0) then {
private _resultSampleMap = missionNamespace getVariable [QEGVAR(circulation,resultSampleMap), []];
_resultSampleMap = _resultSampleMap get _idNumber;
_resultSampleMap = _resultSampleMap select 1;
private _patient = _resultSampleMap select 0;
_resultSampleArray = _resultSampleMap get _idNumber;
_resultSampleActual = _resultSampleArray select 1;
private _patient = _resultSampleArray select 0;

_actions pushBack [
[
Expand All @@ -45,7 +45,7 @@ private _fnc_getActions = {
[]
] call ACEFUNC(interact_menu,createAction),
[],
[_resultSampleMap, _target, _idNumber, _player]
[_resultSampleActual, _target, _idNumber, _player]
];
};
} forEach ([_player, 0] call ACEFUNC(common,uniqueItems));
Expand All @@ -54,4 +54,4 @@ private _fnc_getActions = {
};


[[], _fnc_getActions, _player, QGVAR(actionsCache), 9999, "cba_events_loadoutEvent"] call ACEFUNC(common,cachedCall);
[[], _fnc_getActions, _player, QGVAR(actionsCache), 9999, "cba_events_loadoutEvent"] call ACEFUNC(common,cachedCall);
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@ private _fnc_getActions = {
};


[[], _fnc_getActions, _player, QGVAR(actionsCache), 9999, "cba_events_loadoutEvent"] call ACEFUNC(common,cachedCall);
[[], _fnc_getActions, _player, QGVAR(actionsCache), 9999, "cba_events_loadoutEvent"] call ACEFUNC(common,cachedCall);
3 changes: 1 addition & 2 deletions addons/circulation/functions/fnc_attachBloodGas.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
*/
params ["_entries"];
_entries params ["_bloodGas", "_patient", "_idNumber", "_player"];
_bloodGas params ["_patientName", "_bloodGasArray"];

_patient setVariable [QGVAR(testedBloodGas), _bloodGasArray, true];
_patient setVariable [QGVAR(testedBloodGas), _bloodGas, true];

_player removeItem (format ["KAT_bloodResult_%1",_idNumber]);
2 changes: 1 addition & 1 deletion addons/circulation/functions/fnc_showBloodGas.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ private _resultSampleMap = missionNamespace getVariable [QEGVAR(circulation,resu
_resultCounter = [_resultCounter +1, 1] select (_resultCounter == 20);
missionNamespace setVariable [QEGVAR(circulation,resultCounter), _resultCounter, true];

_resultSampleMap set [_resultCounter, [name(_patient), _bloodGas]];
_resultSampleMap set [_resultCounter, [_patientName, _bloodGasArray]];
missionNamespace setVariable [QEGVAR(circulation,resultSampleMap), _resultSampleMap, true];

private _itemStr = format ["KAT_bloodResult_%1", _resultCounter];
Expand Down
4 changes: 2 additions & 2 deletions addons/watch/XEH_PREP.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
PREP(closeWatchTimer);
PREP(handleRespawn);
PREP(hideKWatch);
PREP(hideCWatch);
Expand All @@ -8,4 +7,5 @@ PREP(init);
PREP(showKWatch);
PREP(showCWatch);
PREP(showSWatch);
PREP(showRWatch);
PREP(showRWatch);
PREP(startWatchTimer);
9 changes: 3 additions & 6 deletions addons/watch/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

if (!hasInterface) exitWith {};

[QGVAR(closeWatchTimer), LINKFUNC(closeWatchTimer)] call CBA_fnc_addEventHandler;
[QGVAR(startWatchTimer), LINKFUNC(startWatchTimer)] call CBA_fnc_addEventHandler;
[QEGVAR(misc,handleRespawn), LINKFUNC(handleRespawn)] call CBA_fnc_addEventHandler;

[QGVAR(playWatchTone), {
Expand Down Expand Up @@ -51,7 +51,7 @@ if (!hasInterface) exitWith {};
[ACE_player] call FUNC(showRWatch);
} else {
call FUNC(hideRWatch);
};
};
};
};

Expand Down Expand Up @@ -96,11 +96,8 @@ if (!hasInterface) exitWith {};
if (_timerActive) then {
ACE_player setVariable [QGVAR(rangerStart), false, false];
} else {
if !(GETMVAR(GVAR(RangerActive),false)) then {
[QGVAR(closeWatchTimer), [ACE_player], ACE_player] call CBA_fnc_targetEvent;
};

ACE_player setVariable [QGVAR(rangerStart), true, false];
[QGVAR(startWatchTimer), [ACE_player], ACE_player] call CBA_fnc_targetEvent;
};
};

Expand Down
4 changes: 2 additions & 2 deletions addons/watch/functions/fnc_handleRespawn.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@
params ["_unit","_dead"];
TRACE_2("handleRespawn",_unit,_dead);

_unit setVariable [QGVAR(RangerStart), false, true];
_unit setVariable [QGVAR(RangerTimer), 0, true];
_unit setVariable [QGVAR(rangerStart), false, true];
_unit setVariable [QGVAR(rangerTimer), 0, true];
17 changes: 1 addition & 16 deletions addons/watch/functions/fnc_showRWatch.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -82,23 +82,8 @@ private _o2 = _display displayCtrl 22810;
_second ctrlSetAngle [(linearConversion [0, 60, _seconds, 0, 360]), 0.5, 0.5, true];

private _timeValue = _unit getVariable [QGVAR(rangerTimer), 0];
private _active = _unit getVariable [QGVAR(rangerStart), false];

_timer ctrlSetText ([_timeValue, 2, 0] call CBA_fnc_formatNumber);

if (_active) then {
_timeValue = (_timeValue - 1) max 0;

_timer ctrlSetText ([_timeValue, 2, 0] call CBA_fnc_formatNumber);
_unit setVariable [QGVAR(rangerTimer), _timeValue, false];

if (_timeValue == 0) then {
_unit setVariable [QGVAR(rangerStart), false, false];
[QGVAR(playWatchTone), [_unit, QGVAR(watchAlarm)], _unit] call CBA_fnc_targetEvent;
};
} else {
_timer ctrlSetText ([_timeValue, 2, 0] call CBA_fnc_formatNumber);
};
}, 1, [
_unit,
_hour,
Expand All @@ -109,4 +94,4 @@ private _o2 = _display displayCtrl 22810;
_altitude,
_hr,
_o2
]] call CBA_fnc_addPerFrameHandler;
]] call CBA_fnc_addPerFrameHandler;
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ params ["_unit"];
_this params ["_args", "_pfhID"];
_args params ["_unit"];

if (GVAR(RangerActive)) exitWith {
_pfhID call CBA_fnc_removePerFrameHandler;
};

if !(alive _unit) exitWith {
_pfhID call CBA_fnc_removePerFrameHandler;
};
Expand All @@ -47,5 +43,7 @@ params ["_unit"];

_pfhID call CBA_fnc_removePerFrameHandler;
};
} else {
_pfhID call CBA_fnc_removePerFrameHandler;
};
}, 1, [_unit]] call CBA_fnc_addPerFrameHandler;
Loading