mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-13 19:52:38 +03:00
player anti wall distance sanity check
This commit is contained in:
@@ -4,29 +4,24 @@
|
||||
*/
|
||||
|
||||
private ["_vehicle","_vehiclePos","_playerPos","_activated","_id","_intersectsWith"];
|
||||
|
||||
_activated = false;
|
||||
|
||||
// Vehicle
|
||||
_vehicle = _this;
|
||||
_vehiclePos = aimpos _vehicle;
|
||||
|
||||
_playerPos = visiblePositionASL player;
|
||||
_playerPos set [2,(_playerPos select 2)+1];
|
||||
|
||||
_intersectsWith = lineIntersectsWith [_playerPos, _vehiclePos, player, _vehicle];
|
||||
|
||||
if ((count _intersectsWith) > 0) then {
|
||||
|
||||
{
|
||||
if (_x isKindOf "Building" or _x isKindOf "DZE_Housebase") exitWith {
|
||||
_activated = true;
|
||||
};
|
||||
} forEach _intersectsWith;
|
||||
if(_activated) then {
|
||||
diag_log format["Player Wall glitched %1 - player: %2 vehicle:%3", player,_playerPos,_vehiclePos];
|
||||
cutText [(localize "str_epoch_player_9"), "PLAIN DOWN"];
|
||||
_id = [player,"bled"] spawn player_death;
|
||||
|
||||
// limit distance just incase
|
||||
if((_playerPos distance _vehiclePos) < 10) then {
|
||||
// diag_log format["Player Wall glitched %1 - player: %2 vehicle:%3", player,_playerPos,_vehiclePos];
|
||||
cutText [(localize "str_epoch_player_9"), "PLAIN DOWN"];
|
||||
_id = [player,"crushed"] spawn player_death;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user