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: Github:
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/compile/EPOCH_getOutMan_EH.sqf 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"]; params ["_unit","_position","_vehicle"];
if (_unit == player) then { if (_unit == player) then {
_start = getPosWorld _vehicle; _this spawn {
// _worldPos set[2, (_worldPos select 2) + 1]; private ["_animationstate","_StartTime","_eyepos","_dirTo","_end","_start"];
_dirTo = _vehicle getDir player; params ["_unit","_position","_vehicle"];
_end = _vehicle getPos [(_vehicle distance player) + 1, _dirTo]; _animationstate = animationstate player;
{ _StartTime = diag_ticktime;
if (_x isKindOf "Const_All_Walls_F") exitWith{ waituntil {diag_ticktime - _StartTime > 5 || _animationstate != (animationstate player)};
player moveInAny _vehicle; if (diag_ticktime - _StartTime > 5) exitwith {};
EPOCH_antiWallCount = EPOCH_antiWallCount + 1; _start = getPosWorld _vehicle;
}; _eyepos = eyepos player;
} forEach lineintersectsobjs[_start, AGLToASL _end, player, _vehicle, true, 2]; _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];
};
}; };