mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
make setHidden use forgetTarget
This commit is contained in:
parent
12208b4ebe
commit
13e52b4410
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user