mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-13 19:52:38 +03:00
Fix change clothes and login over sea level
This also aims for the fix that the player still gets damaged while in debug. It looks like that allowDamage gets lifted when it should not. fn_exitSwim set too early the damage true which can be a problem. Ive decided to remove the handled damage from fn_exitSwim and set allowDamage always false before we enter this function. This needs intensive testing to be sure it works without any new problems. Thx to ndavalos and iben.
This commit is contained in:
@@ -235,19 +235,19 @@ if (typename _this == typename []) then {
|
|||||||
|
|
||||||
_unit = _this select 0;
|
_unit = _this select 0;
|
||||||
if (!local _unit) exitwith {};
|
if (!local _unit) exitwith {};
|
||||||
|
|
||||||
|
_unit allowDamage false; //Prevent glitch death when opening chute
|
||||||
|
|
||||||
//--- Free fall
|
//--- Free fall
|
||||||
if (count _this == 2) exitwith { //Fresh spawn calling from player_monitor.fsm
|
if (count _this == 2) exitwith { //Fresh spawn calling from player_monitor.fsm
|
||||||
_alt = _this select 1;
|
if (surfaceIsWater respawn_west_original) then {_unit call fn_exitSwim;};
|
||||||
_unit call fn_exitSwim;
|
|
||||||
_unit setvariable ["bis_fnc_halo_now",true];
|
_unit setvariable ["bis_fnc_halo_now",true];
|
||||||
_unit spawn bis_fnc_halo;
|
_unit spawn bis_fnc_halo;
|
||||||
};
|
};
|
||||||
//-------------
|
//-------------
|
||||||
|
|
||||||
_para = objnull;
|
_para = objnull;
|
||||||
_vel = [];
|
_vel = [];
|
||||||
_unit allowDamage false; //Prevent glitch death when opening chute
|
|
||||||
_paraPosition1 = [_unit] call FNC_GetPos;
|
_paraPosition1 = [_unit] call FNC_GetPos;
|
||||||
_para = createVehicle ["ParachuteWest", _paraPosition1, [], 0, "CAN_COLLIDE"];
|
_para = createVehicle ["ParachuteWest", _paraPosition1, [], 0, "CAN_COLLIDE"];
|
||||||
//_para = "BIS_Steerable_Parachute" createVehicle position _unit;
|
//_para = "BIS_Steerable_Parachute" createVehicle position _unit;
|
||||||
|
|||||||
@@ -1,12 +1,15 @@
|
|||||||
//This workaround reliably exits swimming after a setPos directly from water to land or air.
|
//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.
|
//"Getting out while IsMoveOutInProgress" prints to client RPT, but it's needed to complete quickly and should be harmless.
|
||||||
|
|
||||||
_unit = _this;
|
local _unit = _this;
|
||||||
_unit allowDamage false;
|
local _paraPosition = [_unit] call FNC_GetPos;
|
||||||
_paraPosition = [_unit] call FNC_GetPos;
|
local _para = "ParachuteWest" createVehicleLocal [0,0,0];
|
||||||
_para = "ParachuteWest" createVehicleLocal [0,0,0];
|
_para setPos [(_paraPosition select 0),(_paraPosition select 1),(_paraPosition select 2) + 0.1];
|
||||||
_para setPos _paraPosition;
|
|
||||||
_unit moveInDriver _para;
|
_unit moveInDriver _para;
|
||||||
deleteVehicle _para;
|
deleteVehicle _para;
|
||||||
_unit setPosATL _paraPosition;
|
|
||||||
_unit allowDamage true;
|
if (surfaceiswater _paraPosition) then {
|
||||||
|
_unit setPosASL _paraPosition;
|
||||||
|
} else {
|
||||||
|
_unit setPosATL _paraPosition;
|
||||||
|
};
|
||||||
@@ -10,7 +10,7 @@ _old removeAllEventHandlers "HandleDamage";
|
|||||||
_old removeAllEventHandlers "Killed";
|
_old removeAllEventHandlers "Killed";
|
||||||
_old removeAllEventHandlers "Fired";
|
_old removeAllEventHandlers "Fired";
|
||||||
_old allowDamage false;
|
_old allowDamage false;
|
||||||
_old AddEventHandler ["HandleDamage", {False}];
|
_old addEventHandler ["handleDamage", {0}];
|
||||||
|
|
||||||
//Logout
|
//Logout
|
||||||
local _humanity = player getVariable ["humanity",0];
|
local _humanity = player getVariable ["humanity",0];
|
||||||
@@ -109,7 +109,7 @@ if (Z_SingleCurrency) then {
|
|||||||
call dayz_resetSelfActions; //New unit has no self actions yet. Reset variables so actions can be added back.
|
call dayz_resetSelfActions; //New unit has no self actions yet. Reset variables so actions can be added back.
|
||||||
dayz_actionInProgress = false; //Allow self actions to run now.
|
dayz_actionInProgress = false; //Allow self actions to run now.
|
||||||
|
|
||||||
player removeAllEventHandlers "HandleDamage";
|
player removeAllEventHandlers "handleDamage";
|
||||||
eh_player_killed = player addeventhandler ["FiredNear",{_this call player_weaponFiredNear;}];
|
eh_player_killed = player addeventhandler ["FiredNear",{_this call player_weaponFiredNear;}];
|
||||||
[player] call fnc_usec_damageHandle;
|
[player] call fnc_usec_damageHandle;
|
||||||
player allowDamage true;
|
player allowDamage true;
|
||||||
|
|||||||
@@ -5,10 +5,7 @@ _class = if (_isArray) then {_this select 0} else {_this};
|
|||||||
if (gear_done) then {disableUserInput true;disableUserInput true;};
|
if (gear_done) then {disableUserInput true;disableUserInput true;};
|
||||||
disableSerialization;
|
disableSerialization;
|
||||||
|
|
||||||
//Old location system causes issues with players getting damaged during movement.
|
_position = [player] call FNC_GetPos;
|
||||||
//_position = getPosATL player;
|
|
||||||
//New system testing needed.
|
|
||||||
_position = player modeltoWorld [0,0,0];
|
|
||||||
_dir = getDir player;
|
_dir = getDir player;
|
||||||
_currentAnim = animationState player;
|
_currentAnim = animationState player;
|
||||||
_currentCamera = cameraView;
|
_currentCamera = cameraView;
|
||||||
@@ -70,9 +67,10 @@ _leader = (player == leader _oldGroup);
|
|||||||
//[player] joinSilent grpNull;
|
//[player] joinSilent grpNull;
|
||||||
_group = createGroup west;
|
_group = createGroup west;
|
||||||
_newUnit = _group createUnit [_class,respawn_west_original,[],0,"NONE"];
|
_newUnit = _group createUnit [_class,respawn_west_original,[],0,"NONE"];
|
||||||
|
_newUnit allowDamage false;
|
||||||
|
|
||||||
if (_isArray) then {
|
if (_isArray) then {
|
||||||
_newUnit allowDamage false;
|
mydamage_eh1 = _newUnit addEventHandler ["handleDamage", {0}];
|
||||||
mydamage_eh1 = _newUnit AddEventHandler ["HandleDamage", {False}];
|
|
||||||
_newUnit setVariable ["characterID",(_this select 1),true];
|
_newUnit setVariable ["characterID",(_this select 1),true];
|
||||||
_newUnit setVariable ["humanity",(_this select 2),true];
|
_newUnit setVariable ["humanity",(_this select 2),true];
|
||||||
_newUnit setVariable ["zombieKills",(_this select 3),true];
|
_newUnit setVariable ["zombieKills",(_this select 3),true];
|
||||||
@@ -112,15 +110,20 @@ if (_secweapon != (secondaryWeapon _newUnit) && _secweapon != "") then {
|
|||||||
|
|
||||||
_switchUnit = {
|
_switchUnit = {
|
||||||
//Make New Unit Playable (1 of these 3 commands causes crashes with gear dialog open)
|
//Make New Unit Playable (1 of these 3 commands causes crashes with gear dialog open)
|
||||||
//_oldUnit setPosATL [_position select 0 + cos(_dir) * 2, _position select 1 + sin(_dir) * 2, _position select 2];
|
|
||||||
addSwitchableUnit _newUnit;
|
addSwitchableUnit _newUnit;
|
||||||
setPlayable _newUnit;
|
setPlayable _newUnit;
|
||||||
selectPlayer _newUnit;
|
selectPlayer _newUnit;
|
||||||
//Switch the units
|
//Switch the units
|
||||||
_rndx = floor(random 100);
|
_rndx = floor(random 100);
|
||||||
_rndy = floor(random 100);
|
_rndy = floor(random 100);
|
||||||
_oldUnit setPosATL [(respawn_west_original select 0) + _rndx, (respawn_west_original select 1) + _rndy, 0];
|
_oldUnit setPosATL [(respawn_west_original select 0) + _rndx, (respawn_west_original select 1) + _rndy, 0];
|
||||||
_newUnit setPosATL _position;
|
|
||||||
|
if (surfaceIsWater _position) then {
|
||||||
|
_newUnit setPosASL _position;
|
||||||
|
} else {
|
||||||
|
_newUnit setPosATL _position;
|
||||||
|
};
|
||||||
|
|
||||||
if (surfaceIsWater respawn_west_original) then {_newUnit call fn_exitSwim;};
|
if (surfaceIsWater respawn_west_original) then {_newUnit call fn_exitSwim;};
|
||||||
removeAllWeapons _oldUnit;
|
removeAllWeapons _oldUnit;
|
||||||
{_oldUnit removeMagazine _x;} count magazines _oldUnit;
|
{_oldUnit removeMagazine _x;} count magazines _oldUnit;
|
||||||
|
|||||||
@@ -627,7 +627,6 @@ class FSM
|
|||||||
"" \n
|
"" \n
|
||||||
"_model call player_switchModel;" \n
|
"_model call player_switchModel;" \n
|
||||||
"" \n
|
"" \n
|
||||||
"player allowDamage false;" \n
|
|
||||||
"_lastAte = _survival select 1;" \n
|
"_lastAte = _survival select 1;" \n
|
||||||
"_lastDrank = _survival select 2;" \n
|
"_lastDrank = _survival select 2;" \n
|
||||||
"" \n
|
"" \n
|
||||||
|
|||||||
Reference in New Issue
Block a user