Done I think

This commit is contained in:
PabstMirror 2015-01-13 21:36:53 -06:00
parent d3f5304f62
commit cb9b38bca2
2 changed files with 15 additions and 10 deletions

View File

@ -1,6 +1,6 @@
class Extended_PostInit_EventHandlers {
class ADDON {
clientInit = "QUOTE(call COMPILE_FILE(XEH_post_initClient));
serverInit = "QUOTE(call COMPILE_FILE(XEH_post_initServer));
clientInit = QUOTE(call COMPILE_FILE(XEH_post_initClient));
serverInit = QUOTE(call COMPILE_FILE(XEH_post_initServer));
};
};

View File

@ -2,19 +2,24 @@
#include "script_component.hpp"
0 spawn {
waitUntil {!isNull AGM_player};
_setupPlayer = {
if (!isNull ACE_player) then {
[(_this select 1)] call cba_fnc_removePerFrameHandler;
[AGM_player] call AGM_Core_fnc_muteUnit;
AGM_player setVariable [QGVAR(isMuted), true, true];
[ACE_player] call EFUNC(common,muteUnit);
ACE_player setVariable [QGVAR(isMuted), true, true];
};
};
[_setupPlayer, 0, []] call CBA_fnc_addPerFrameHandler;
[missionNamespace, "playerChanged", {
[_this select 0] call AGM_Core_fnc_muteUnit;
//On player change, mute old unit and unmute new player
[_this select 0] call EFUNC(common,muteUnit);
(_this select 0) setVariable [QGVAR(isMuted), true, true];
if (!((_this select 1) getVariable ["AGM_isUnconscious", false]) && {alive (_this select 1)}) then {
[_this select 1] call AGM_Core_fnc_unmuteUnit;
if (!((_this select 1) getVariable ["ACE_isUnconscious", false]) && {alive (_this select 1)}) then { //@todo: ACE_isUnconscious???
[_this select 1] call EFUNC(common,unMuteUnit);
};
(_this select 1) setVariable [QGVAR(isMuted), false, true];
}] call AGM_Core_fnc_addCustomEventHandler;
}] call EFUNC(common,addCustomEventHandler);