From 8ff511d3ee9ebdc15b4a5e9b2dc842941842b66a Mon Sep 17 00:00:00 2001 From: He-Man Date: Wed, 8 Nov 2017 19:27:01 +0100 Subject: [PATCH] Reworked GetOutMan EH - Allows to park closer to walls - Better prevent against Wall Glitching - Now works for all Buildings (not only Epoch Walls) --- .../event_handlers/EPOCH_getOutMan.sqf | 33 +++++++++++-------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/Sources/epoch_code/compile/event_handlers/EPOCH_getOutMan.sqf b/Sources/epoch_code/compile/event_handlers/EPOCH_getOutMan.sqf index 55684ae5..1f4d9767 100644 --- a/Sources/epoch_code/compile/event_handlers/EPOCH_getOutMan.sqf +++ b/Sources/epoch_code/compile/event_handlers/EPOCH_getOutMan.sqf @@ -13,19 +13,26 @@ Github: https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/compile/EPOCH_getOutMan_EH.sqf */ -//[[[cog import generate_private_arrays ]]] -private ["_dirTo","_end","_start"]; -//[[[end]]] + params ["_unit","_position","_vehicle"]; if (_unit == player) then { - _start = getPosWorld _vehicle; - // _worldPos set[2, (_worldPos select 2) + 1]; - _dirTo = _vehicle getDir player; - _end = _vehicle getPos [(_vehicle distance player) + 1, _dirTo]; - { - if (_x isKindOf "Const_All_Walls_F") exitWith{ - player moveInAny _vehicle; - EPOCH_antiWallCount = EPOCH_antiWallCount + 1; - }; - } forEach lineintersectsobjs[_start, AGLToASL _end, player, _vehicle, true, 2]; + _this spawn { + private ["_animationstate","_StartTime","_eyepos","_dirTo","_end","_start"]; + params ["_unit","_position","_vehicle"]; + _animationstate = animationstate player; + _StartTime = diag_ticktime; + waituntil {diag_ticktime - _StartTime > 5 || _animationstate != (animationstate player)}; + if (diag_ticktime - _StartTime > 5) exitwith {}; + _start = getPosWorld _vehicle; + _eyepos = eyepos player; + _dirTo = _start getDir _eyepos; + _end = _start getPos [(_start distance _eyepos) + 0.5, _dirTo]; + _end set [2,_eyepos select 2]; + { + if (_x isKindOf "Building") exitWith{ + player moveInAny _vehicle; + EPOCH_antiWallCount = EPOCH_antiWallCount + 1; + }; + } forEach lineintersectsobjs [_start, _end, player, _vehicle, true, 2]; + }; };