mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
common: ACE local event for playerChanged
This commit is contained in:
parent
60270d5415
commit
34135ffdd4
@ -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);
|
||||
|
||||
|
||||
|
@ -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;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user