ACE3/addons/map_gestures/functions/fnc_transmit.sqf
Joko ab989d4c34
Map Gestures - Improve transmit process (#7646)
* simplify map gestures transmit process

* Update addons/map_gestures/functions/fnc_transmit.sqf

Co-Authored-By: mharis001 <34453221+mharis001@users.noreply.github.com>

* Update addons/map_gestures/functions/fnc_transmit.sqf

Co-Authored-By: mharis001 <34453221+mharis001@users.noreply.github.com>

* Update addons/map_gestures/functions/fnc_transmit.sqf

Co-Authored-By: mharis001 <34453221+mharis001@users.noreply.github.com>

* remove setPlayerOwner call

Co-authored-by: mharis001 <34453221+mharis001@users.noreply.github.com>
2020-04-18 19:15:12 -05:00

37 lines
770 B
Plaintext

#include "script_component.hpp"
/*
* Author: Dslyecxi, MikeMatrix
* 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
*/
BEGIN_COUNTER(transmit);
params ["", "_pfhId"];
if (!visibleMap) then {
call FUNC(endTransmit);
};
if (!GVAR(EnableTransmit) || !visibleMap) exitWith {
[_pfhId] call CBA_fnc_removePerFrameHandler;
};
private _remotePos = ACE_player getVariable [QGVAR(pointPosition), [0, 0, 0]];
if (_remotePos distance2D GVAR(pointPosition) > 1) then { // Only transmit when actually moving
ACE_player setVariable [QGVAR(pointPosition), GVAR(pointPosition), true];
};
END_COUNTER(transmit);