Skip to content

Commit

Permalink
Merge pull request #5987 from acemod/setHidden-forgetTarget
Browse files Browse the repository at this point in the history
make setHidden use forgetTarget
  • Loading branch information
commy2 authored Jan 2, 2018
2 parents bcf834d + 32755e4 commit ef77bb0
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions addons/common/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@
if (_vis != 0) then {
_object setVariable [QGVAR(oldVisibility), _vis];
_object setUnitTrait ["camouflageCoef", 0];
{
if (side _x != side group _object) then {
_x forgetTarget _object;
};
} forEach allGroups;
};
} else {
_vis = _object getVariable [QGVAR(oldVisibility), _vis];
Expand Down Expand Up @@ -277,10 +282,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;
Expand All @@ -301,14 +306,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;
Expand Down

0 comments on commit ef77bb0

Please sign in to comment.