common: ACE local event for playerChanged

This commit is contained in:
Nicolás Badano 2015-01-16 12:14:18 -03:00
parent 60270d5415
commit 34135ffdd4
2 changed files with 9 additions and 7 deletions

View File

@ -63,13 +63,15 @@ call COMPILE_FILE(scripts\KeyInput\initScrollWheel);
enableCamShake true;
// Set the name for the current player
[missionNamespace, "playerChanged", {
if (alive (_this select 0)) then {
[_this select 0] call FUNC(setName)
["playerChanged", {
EXPLODE_2_PVT(_this,_newPlayer,_oldPlayer);
if (alive _newPlayer) then {
[_newPlayer] call FUNC(setName)
};
if (alive (_this select 1)) then {
[_this select 1] call FUNC(setName)
if (alive _oldPlayer) then {
[_oldPlayer] call FUNC(setName)
};
}] call FUNC(addCustomEventhandler);
}] call FUNC(addEventhandler);

View File

@ -177,7 +177,7 @@ if (hasInterface) then {
// Raise custom event. @todo, remove
[missionNamespace, "playerChanged", [ACE_player, _oldPlayer]] call FUNC(callCustomEventHandlers);
// Raise ACE event
["playerChanged", [ACE_player, _oldPlayer]]] call FUNC(localEvent);
["playerChanged", [ACE_player, _oldPlayer]] call FUNC(localEvent);
};
}, 0, []] call cba_fnc_addPerFrameHandler;
};