ACE3/addons/dragging/functions/fnc_handlePlayerChanged.sqf
jokoho48 79cf8dd98e Fixing Some Spelling
Remove Some forgotten Commands
2015-08-09 15:20:50 +02:00

31 lines
673 B
Plaintext

/*
* Author: commy2
*
* Handle player changes.
*
* Arguments:
* 0: New Player Unit <OBJECT>
* 1: Old Player Unit <OBJECT>
*
* Return Value:
* None
*
* Example:
* [_unitNew, _unitOld] call ace_dragging_fnc_handlePlayerChanged;
*
* Public: No
*/
#include "script_component.hpp"
params ["_newPlayer", "_oldPlayer"];
{
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];