2015-08-08 06:26:15 +00:00
|
|
|
/*
|
2015-08-10 06:45:43 +00:00
|
|
|
* Author: Dslyecxi, MikeMatrix
|
2015-08-08 06:26:15 +00:00
|
|
|
* Transmit PFH
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Arguments <ARRAY>
|
|
|
|
* 1: PFH ID <NUMBER>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* Return description <TYPE>
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [[], 2] call ace_map_gestures_fnc_transmit
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2016-10-27 17:54:58 +00:00
|
|
|
BEGIN_COUNTER(transmit);
|
2015-08-08 06:26:15 +00:00
|
|
|
|
|
|
|
params ["", "_pfhId"];
|
|
|
|
|
2015-08-24 15:03:47 +00:00
|
|
|
if (!visibleMap) then {
|
2015-08-08 06:26:15 +00:00
|
|
|
call FUNC(endTransmit);
|
2015-08-24 15:28:08 +00:00
|
|
|
};
|
2015-08-24 15:03:47 +00:00
|
|
|
|
|
|
|
if (!GVAR(EnableTransmit) || !visibleMap) exitWith {
|
2015-08-08 06:26:15 +00:00
|
|
|
[_pfhId] call CBA_fnc_removePerFrameHandler;
|
|
|
|
};
|
|
|
|
|
|
|
|
{
|
2016-10-27 17:54:58 +00:00
|
|
|
private _owner = _x getVariable [QEGVAR(common,playerOwner), -1];
|
|
|
|
if (_owner > -1) then {
|
|
|
|
private _remotePos = _x getVariable [QGVAR(remotePos), [0,0,0]];
|
|
|
|
if ((_remotePos distance2d GVAR(pointPosition)) > 1) then { // Only transmit when actually moving
|
|
|
|
[QGVAR(syncPos), [ACE_Player, GVAR(pointPosition)], _owner] call CBA_fnc_ownerEvent;
|
|
|
|
_x setVariable [QGVAR(remotePos), GVAR(pointPosition)];
|
2015-08-10 15:07:01 +00:00
|
|
|
};
|
2015-08-08 06:26:15 +00:00
|
|
|
};
|
2015-08-24 15:03:47 +00:00
|
|
|
} count ([ACE_player, GVAR(maxRange)] call FUNC(getProximityPlayers));
|
2016-10-27 17:54:58 +00:00
|
|
|
|
|
|
|
END_COUNTER(transmit);
|