mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-18 01:30:26 +03:00
Add reliable workaround for swimming in ground and air issue
Fixes #1913
This commit is contained in:
@@ -239,14 +239,8 @@ if (typename _this == typename []) then {
|
||||
//--- Free fall
|
||||
if (count _this == 2) exitwith { //Fresh spawn calling from player_monitor.fsm
|
||||
_alt = _this select 1;
|
||||
_unit allowDamage false;
|
||||
_paraPosition = [_unit] call FNC_GetPos;
|
||||
//_paraPosition set [2,_alt];
|
||||
_para = createVehicle ["ParachuteWest", _paraPosition, [], 0, "CAN_COLLIDE"];
|
||||
_para setpos _paraPosition;
|
||||
_unit moveindriver _para; //Workaround for stuck swimming in air on maps with respawn_west in water. Can't setPos to ground first because antiTP blocks it.
|
||||
_unit call fn_exitSwim;
|
||||
_unit setvariable ["bis_fnc_halo_now",true];
|
||||
_unit allowDamage true;
|
||||
_unit spawn bis_fnc_halo;
|
||||
};
|
||||
//-------------
|
||||
|
||||
11
SQF/dayz_code/compile/fn_exitSwim.sqf
Normal file
11
SQF/dayz_code/compile/fn_exitSwim.sqf
Normal file
@@ -0,0 +1,11 @@
|
||||
//This workaround reliably exits swimming after a setPos directly from water to land or air.
|
||||
//"Getting out while IsMoveOutInProgress" prints to client RPT, but it's needed to complete quickly and should be harmless.
|
||||
|
||||
_unit = _this;
|
||||
_unit allowDamage false;
|
||||
_paraPosition = [_unit] call FNC_GetPos;
|
||||
_para = "ParachuteWest" createVehicleLocal [0,0,0];
|
||||
_para setPos _paraPosition;
|
||||
_unit moveInDriver _para;
|
||||
deleteVehicle _para;
|
||||
_unit allowDamage true;
|
||||
@@ -113,6 +113,7 @@ _switchUnit = {
|
||||
_rndy = floor(random 100);
|
||||
_oldUnit setPosATL [(respawn_west_original select 0) + _rndx, (respawn_west_original select 1) + _rndy, 0];
|
||||
_newUnit setPosATL _position;
|
||||
if (surfaceIsWater respawn_west_original) then {_newUnit call fn_exitSwim;};
|
||||
removeAllWeapons _oldUnit;
|
||||
{_oldUnit removeMagazine _x;} count magazines _oldUnit;
|
||||
if !(isNull _oldUnit) then {deleteVehicle _oldUnit;};
|
||||
|
||||
Reference in New Issue
Block a user