Skip to content

Commit

Permalink
Common - Add separate blockSpeaking status for acre direct (#8904)
Browse files Browse the repository at this point in the history
* Add separate blockSPeaking status for acre direct

* Move TFAR code to new blockSpeaking handler

Co-authored-by: PabstMirror <pabstmirror@gmail.com>
  • Loading branch information
tbeswick96 and PabstMirror authored May 8, 2022
1 parent b20aa76 commit 27c5464
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
12 changes: 12 additions & 0 deletions addons/common/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
["blockThrow", false, ["ACE_Attach", "ACE_concertina_wire", "ACE_dragging", "ACE_Explosives", "ACE_Ladder", "ACE_rearm", "ACE_refuel", "ACE_Sandbag", "ACE_Trenches", "ACE_tripod"]] call FUNC(statusEffect_addType);
["setHidden", true, ["ace_unconscious"]] call FUNC(statusEffect_addType);
["blockRadio", false, [QEGVAR(captives,Handcuffed), QEGVAR(captives,Surrendered), "ace_unconscious"]] call FUNC(statusEffect_addType);
["blockSpeaking", false, ["ace_unconscious"]] call FUNC(statusEffect_addType);

[QGVAR(forceWalk), {
params ["_object", "_set"];
Expand Down Expand Up @@ -86,6 +87,17 @@
};
}] call CBA_fnc_addEventHandler;

[QGVAR(blockSpeaking), {
params ["_object", "_set"];
TRACE_2("blockSpeaking EH",_object,_set);
if (["acre_main"] call FUNC(isModLoaded)) then {
_object setVariable ["acre_sys_core_isDisabled", _set > 0, true];
};
if (["task_force_radio"] call FUNC(isModLoaded)) then {
_object setVariable ["tf_voiceVolume", [1, 0] select (_set > 0), true];
};
}] call CBA_fnc_addEventHandler;

[QGVAR(blockDamage), { //Name reversed from `allowDamage` because we want NOR logic
params ["_object", "_set"];
if ((_object isKindOf "CAManBase") && {(["ace_medical"] call FUNC(isModLoaded))}) then {
Expand Down
2 changes: 0 additions & 2 deletions addons/common/functions/fnc_setVolume.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ if (_setVolume) then {
2 fadeSound NORMAL_LEVEL;

// TFAR
_unit setVariable ["tf_voiceVolume", NORMAL_LEVEL, true];
_unit setVariable ["tf_globalVolume", NORMAL_LEVEL];

// ACRE2
Expand All @@ -42,7 +41,6 @@ if (_setVolume) then {
2 fadeSound MUTED_LEVEL;

// TFAR
_unit setVariable ["tf_voiceVolume", NO_SOUND, true];
_unit setVariable ["tf_globalVolume", MUTED_LEVEL];

// ACRE2
Expand Down
3 changes: 3 additions & 0 deletions addons/medical_status/functions/fnc_setUnconsciousState.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ _unit setVariable [VAR_UNCON, _active, true];
// Block radio on unconsciousness for compatibility with captive module
[_unit, "blockRadio", "ace_unconscious", _active] call EFUNC(common,statusEffect_set);

// Block speaking on unconsciousness
[_unit, "blockSpeaking", "ace_unconscious", _active] call EFUNC(common,statusEffect_set);

if (_active) then {
// Don't bother setting this if not used
if (EGVAR(medical,spontaneousWakeUpChance) > 0) then {
Expand Down

0 comments on commit 27c5464

Please sign in to comment.