ACE3/addons/tacticalladder/functions/fnc_handlePlayerChanged.sqf
2017-12-30 16:38:45 +03:00

30 lines
607 B
Plaintext

/*
* Author: commy2
* Handle player changes.
*
* Arguments:
* 0: New Player Unit <OBJECT>
* 1: Old Player Unit <OBJECT>
*
* Return Value:
* None
*
* Example:
* [bob, kevin] call ace_tacticalladder_fnc_handlePlayerChanged
*
* Public: No
*/
#include "script_component.hpp"
if (isNull GETGVAR(ladder,objNull)) exitWith {};
params ["_newPlayer", "_oldPlayer"];
if (GVAR(ladder) in attachedObjects _newPlayer) then {
[_newPlayer, GVAR(ladder)] call FUNC(cancelTLdeploy);
};
if (GVAR(ladder) in attachedObjects _oldPlayer) then {
[_oldPlayer, GVAR(ladder)] call FUNC(cancelTLdeploy);
};