mute implementation in noradio, handle post init on remote units

This commit is contained in:
commy2
2015-04-12 11:17:58 +02:00
parent 54f29d75f5
commit e87f491470
6 changed files with 32 additions and 23 deletions

View File

@ -26,6 +26,9 @@ class Extended_InitPost_EventHandlers {
class GVAR(forceWalk) {
init = QUOTE(if (local (_this select 0)) then {_this call FUNC(applyForceWalkStatus);};);
};
class GVAR(muteUnit) {
init = QUOTE(_this call FUNC(muteUnitHandleInitPost));
};
};
};

View File

@ -124,6 +124,7 @@ PREP(moduleCheckPBOs);
PREP(moduleLSDVehicles);
PREP(moveToTempGroup);
PREP(muteUnit);
PREP(muteUnitHandleInitPost);
PREP(muteUnitHandleRespawn);
PREP(numberToDigits);
PREP(numberToDigitsString);

View File

@ -33,6 +33,6 @@ _speaker = speaker _unit;
if (_speaker == "ACE_NoVoice") exitWith {};
["setSpeaker", _unit, [_unit, "ACE_NoVoice"]] call FUNC(targetEvent);
["setSpeaker", [_unit, "ACE_NoVoice"]] call FUNC(globalEvent);
_unit setVariable ["ACE_OriginalSpeaker", _speaker, true];

View File

@ -0,0 +1,11 @@
// by commy2
#include "script_component.hpp"
private "_unit";
_unit = _this select 0;
// setSpeaker gets overwritten after init on remote units; if unit is muted, setSpeaker again
if (count (_unit getVariable [QGVAR(muteUnitReasons), []]) > 0) then {
["setSpeaker", [_unit, "ACE_NoVoice"]] call FUNC(localEvent);
};