From 5f1312b3019354419c2670758cf34aac926bf5b7 Mon Sep 17 00:00:00 2001 From: commy2 Date: Fri, 29 Dec 2017 02:48:20 +0100 Subject: [PATCH 1/2] make setHidden use forgetTarget --- addons/common/XEH_postInit.sqf | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index 82637c1e7cb..e7a28444fd5 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -53,6 +53,9 @@ if (_vis != 0) then { _object setVariable [QGVAR(oldVisibility), _vis]; _object setUnitTrait ["camouflageCoef", 0]; + { + _x forgetTarget _object; + } forEach allGroups; }; } else { _vis = _object getVariable [QGVAR(oldVisibility), _vis]; @@ -277,10 +280,10 @@ addMissionEventHandler ["PlayerViewChanged", { // On non-server client this command is semi-broken // arg index 5 should be the controlled UAV, but it will often be objNull (delay from locality switching?) // On PlayerViewChanged event, start polling for new uav state for a few seconds (should be done within a few frames) - + params ["", "", "", "", "_newCameraOn", "_UAV"]; TRACE_2("PlayerViewChanged",_newCameraOn,_UAV); - + [{ if (isNull player) exitWith {true}; private _UAV = getConnectedUAV player; @@ -301,14 +304,14 @@ addMissionEventHandler ["PlayerViewChanged", { _seatAI = gunner _UAV; }; }; - + private _newArray = [_UAV, _seatAI, _turret, _position]; if (_newArray isEqualTo ACE_controlledUAV) exitWith {false}; // no change yet - + TRACE_2("Seat Change",_newArray,ACE_controlledUAV); ACE_controlledUAV = _newArray; ["ACE_controlledUAV", _newArray] call CBA_fnc_localEvent; - + // stay in the loop as we might switch from gunner -> driver, and there may be a empty position event in-between false }, {}, [], 3, {TRACE_1("timeout",_this);}] call CBA_fnc_waitUntilAndExecute; From e07c42591f8bcab50966d8509ab54aee91066a47 Mon Sep 17 00:00:00 2001 From: commy2 Date: Tue, 2 Jan 2018 16:26:13 +0100 Subject: [PATCH 2/2] forget only different side --- addons/common/XEH_postInit.sqf | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index e7a28444fd5..61061a9a1cd 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -54,7 +54,9 @@ _object setVariable [QGVAR(oldVisibility), _vis]; _object setUnitTrait ["camouflageCoef", 0]; { - _x forgetTarget _object; + if (side _x != side group _object) then { + _x forgetTarget _object; + }; } forEach allGroups; }; } else {