mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 20:13:13 +03:00
Set unit posATL in switchModel if respawn is in water
Reverts:bcc16a0135See:e8e5d24e80
This commit is contained in:
@@ -108,7 +108,12 @@ _switchUnit = {
|
||||
_rndx = floor(random 100);
|
||||
_rndy = floor(random 100);
|
||||
_oldUnit setPosATL [(_createSafePos select 0) + _rndx, (_createSafePos select 1) + _rndy, 0];
|
||||
_newUnit setPosATL _position;
|
||||
if (surfaceIsWater _createSafePos) then {
|
||||
//Prevent swimming in ground glitch if respawn is in water
|
||||
_newUnit setPosATL [_position select 0,_position select 1,(_position select 2)+.1];
|
||||
} else {
|
||||
_newUnit setPosATL _position;
|
||||
};
|
||||
removeAllWeapons _oldUnit;
|
||||
{_oldUnit removeMagazine _x;} count magazines _oldUnit;
|
||||
if !(isNull _oldUnit) then {deleteVehicle _oldUnit;};
|
||||
|
||||
Reference in New Issue
Block a user