From ad7a12771abf32458a6019aa619f42d496049b01 Mon Sep 17 00:00:00 2001 From: ebayShopper Date: Wed, 22 Mar 2017 14:59:31 -0400 Subject: [PATCH] Fix swimming in ground again #1913 Closes #1913 --- CHANGE LOG 1.0.6.2.txt | 1 + SQF/dayz_code/compile/player_switchModel.sqf | 2 +- SQF/dayz_code/system/player_monitor.fsm | 2 +- SQF/dayz_server/init/server_functions.sqf | 12 ++++++++++++ 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/CHANGE LOG 1.0.6.2.txt b/CHANGE LOG 1.0.6.2.txt index 950ba4f91..8d08312b9 100644 --- a/CHANGE LOG 1.0.6.2.txt +++ b/CHANGE LOG 1.0.6.2.txt @@ -12,6 +12,7 @@ [FIXED] Player_forceSave is now called correctly when the abort menu is opened. It was previously using the wrong variable and time. [FIXED] The unconscious wake up animation can no longer be skipped by using a bandage or other right click actions. [FIXED] Sharpening a knife will no longer delete one if the player already had a fully sharpened knife on their toolbelt (duplicate weapon). +[FIXED] Swimming in ground when relogging on some maps again. #1913 @Cherdenko [NOTE] Fixes below are included in the mission file and server pbo as part of server package 1.0.6.1A (March 10th 2017) [FIXED] Fixed food and drink going down 10x faster from melee and other "working" actions. diff --git a/SQF/dayz_code/compile/player_switchModel.sqf b/SQF/dayz_code/compile/player_switchModel.sqf index 8dba812f5..958be2e49 100644 --- a/SQF/dayz_code/compile/player_switchModel.sqf +++ b/SQF/dayz_code/compile/player_switchModel.sqf @@ -112,7 +112,7 @@ _switchUnit = { _rndx = floor(random 100); _rndy = floor(random 100); _oldUnit setPosATL [(respawn_west_original select 0) + _rndx, (respawn_west_original select 1) + _rndy, 0]; - _newUnit setPosATL [_position select 0,_position select 1,(_position select 2)+.1]; //Prevents swimming in ground glitch + _newUnit setPosATL _position; removeAllWeapons _oldUnit; {_oldUnit removeMagazine _x;} count magazines _oldUnit; if !(isNull _oldUnit) then {deleteVehicle _oldUnit;}; diff --git a/SQF/dayz_code/system/player_monitor.fsm b/SQF/dayz_code/system/player_monitor.fsm index f9fbc2dc3..5be6d9069 100644 --- a/SQF/dayz_code/system/player_monitor.fsm +++ b/SQF/dayz_code/system/player_monitor.fsm @@ -994,7 +994,7 @@ class FSM "if (dayz_paraSpawn && freshSpawn == 2) then {" \n " player setPosATL [_setPos select 0,_setPos select 1,DZE_HaloSpawnHeight];" \n "} else {" \n - " player setPosATL [_setPos select 0,_setPos select 1,(_setPos select 2)+.1]; //Prevents swimming in ground glitch" \n + " player setPosATL _setPos;" \n "};" \n "" \n "player setVelocity [0,0,0.5];" \n diff --git a/SQF/dayz_server/init/server_functions.sqf b/SQF/dayz_server/init/server_functions.sqf index 443035622..3b05b1274 100644 --- a/SQF/dayz_server/init/server_functions.sqf +++ b/SQF/dayz_server/init/server_functions.sqf @@ -269,3 +269,15 @@ array_reduceSize = { // Precise base building 1.0.5 call compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\kk_functions.sqf"; #include "mission_check.sqf" + +/* + Create platform if respawn_west position is in water + Makes sure player is standing instead of swimming when teleported to land or air +*/ +private "_platform"; +if (surfaceIsWater respawn_west_original) then { + _platform = createVehicle ["Land_Dirthump01",[0,0,0],[],0,"CAN_COLLIDE"]; + _platform setPosASL [respawn_west_original select 0, respawn_west_original select 1, -0.1]; + _platform setVehicleInit "this enableSimulation false;this allowDamage false;"; + processInitCommands; +}; \ No newline at end of file