mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
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>
This commit is contained in:
parent
4302a944d7
commit
ab989d4c34
@ -8,16 +8,8 @@ if (!hasInterface) exitWith {};
|
||||
|
||||
["ace_settingsInitialized", {
|
||||
if (!GVAR(enabled)) exitWith {};
|
||||
|
||||
// This will set QEGVAR(common,playerOwner) var on player objects
|
||||
[] call EFUNC(common,setPlayerOwner);
|
||||
|
||||
GVAR(pointPosition) = [0,0,0];
|
||||
|
||||
[QGVAR(syncPos), {
|
||||
params ["_unit", "_pointPos"];
|
||||
_unit setVariable [QGVAR(pointPosition), _pointPos];
|
||||
}] call CBA_fnc_addEventHandler;
|
||||
GVAR(pointPosition) = [0,0,0];
|
||||
|
||||
[{
|
||||
if (isNull (findDisplay 12)) exitWith {};
|
||||
|
@ -28,15 +28,9 @@ if (!GVAR(EnableTransmit) || !visibleMap) exitWith {
|
||||
[_pfhId] call CBA_fnc_removePerFrameHandler;
|
||||
};
|
||||
|
||||
{
|
||||
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)];
|
||||
};
|
||||
};
|
||||
} count ([ACE_player, GVAR(maxRange)] call FUNC(getProximityPlayers));
|
||||
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);
|
||||
|
Loading…
Reference in New Issue
Block a user