Reworked GetOutMan EH

- Allows to park closer to walls
- Better prevent against Wall Glitching
- Now works for all Buildings (not only Epoch Walls)
This commit is contained in:
He-Man 2017-11-08 19:27:01 +01:00
parent 362ec1217b
commit 8ff511d3ee

View File

@ -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];
};
};