ACE3/addons/dragging/functions/fnc_handlePlayerChanged.sqf

31 lines
715 B
Plaintext
Raw Normal View History

2015-08-09 12:53:13 +00:00
/*
* Author: commy2
* Handle player changes.
2015-08-09 12:53:13 +00:00
*
* Arguments:
* 0: New Player Unit <OBJECT>
* 1: Old Player Unit <OBJECT>
*
* Return Value:
* None
*
* Example:
2016-01-28 18:52:53 +00:00
* [_newPlayer, _oldPlayer] call ace_dragging_fnc_handlePlayerChanged;
2015-08-09 12:53:13 +00:00
*
* Public: No
*/
2015-03-18 14:42:33 +00:00
#include "script_component.hpp"
2015-08-09 12:53:13 +00:00
params ["_newPlayer", "_oldPlayer"];
2016-01-28 18:52:53 +00:00
TRACE_2("params",_newPlayer,_oldPlayer);
2015-03-18 14:42:33 +00:00
{
if (_x getVariable [QGVAR(isDragging), false]) then {
[_x, _x getVariable [QGVAR(draggedObject), objNull]] call FUNC(dropObject);
};
if (_x getVariable [QGVAR(isCarrying), false]) then {
[_x, _x getVariable [QGVAR(carriedObject), objNull]] call FUNC(dropObject_carry);
};
} forEach [_newPlayer, _oldPlayer];