From b32e77eb111e3d38a252bff99c72b5d50e47912a Mon Sep 17 00:00:00 2001 From: He-Man Date: Fri, 19 Apr 2019 22:48:07 +0200 Subject: [PATCH] Better "watch through" fix Thx to @mgtdb for his help and switchCamera tip! --- .../compile/setup/masterLoop/Event0.sqf | 37 +++++++++++++------ .../compile/setup/masterLoop/init.sqf | 9 +++++ 2 files changed, 35 insertions(+), 11 deletions(-) diff --git a/Sources/epoch_code/compile/setup/masterLoop/Event0.sqf b/Sources/epoch_code/compile/setup/masterLoop/Event0.sqf index c73a7a1e..e6ae1a7d 100644 --- a/Sources/epoch_code/compile/setup/masterLoop/Event0.sqf +++ b/Sources/epoch_code/compile/setup/masterLoop/Event0.sqf @@ -10,16 +10,31 @@ if (EPOCH_IsAutoRunning) then { }; }; -if (animationstate player in ['aadjpknlmstpsraswpstddown','aadjpknlmstpsraswrflddown'] && cameraview == 'GUNNER' && (player weapondirection (currentweapon player)) select 2 < -0.88) then { - _fadedblack = true; - TitleText ['Stop BugUsing!','BLACK FADED']; +if (player == vehicle player && {getPosATL player select 2 > 0.4} && {cameraview == 'GUNNER'}) then { + _weapondir = player weapondirection (currentweapon player); + if (animationstate player in ['aadjpknlmstpsraswpstddown','aadjpknlmstpsraswrflddown'] && {_weapondir select 2 < -0.88}) then { + player switchCamera "EXTERNAL"; + player playAction "AdjustF"; + _fadedblack = true; + TitleText ['Stop BugUsing!','BLACK FADED']; + } + else { + _eyePos = eyepos player; + _eyedist = 0.25; + _end = [((_eyePos select 0)+_eyedist*(_weapondir select 0)),((_eyePos select 1)+_eyedist*(_weapondir select 1)),((_eyePos select 2)+_eyedist*(_weapondir select 2))]; + _objects = lineintersectswith [_eyePos,_end,player]; + _objects = _objects select {_x iskindof "Constructions_static_F"}; + if !(_objects isequalto []) then { + player switchCamera "EXTERNAL"; + _fadedblack = true; + TitleText ['Stop BugUsing!','BLACK FADED']; + } + else { + call _UnFadeCheck; + }; + }; } else { - if(_fadedblack) then { - [] spawn { - uisleep 2; - TitleText ['','PLAIN DOWN']; - }; - _fadedblack = false; - }; -}; \ No newline at end of file + call _UnFadeCheck; +}; + diff --git a/Sources/epoch_code/compile/setup/masterLoop/init.sqf b/Sources/epoch_code/compile/setup/masterLoop/init.sqf index e22e036c..dc4783a5 100644 --- a/Sources/epoch_code/compile/setup/masterLoop/init.sqf +++ b/Sources/epoch_code/compile/setup/masterLoop/init.sqf @@ -15,6 +15,15 @@ _clientAliveTimer = diag_tickTime; // Fade Black Screen _fadedblack = false; +_UnFadeCheck = { + if(_fadedblack) then { + [] spawn { + uisleep 1.5; + TitleText ['','PLAIN DOWN']; + }; + _fadedblack = false; + }; +}; // Lootspawner _LootSpawned = false;