diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index 82637c1e7c..e7a28444fd 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;