From 72f3779edbc55ef67c934305984bfd7b0205c36c Mon Sep 17 00:00:00 2001 From: icomrade Date: Mon, 9 May 2016 00:27:34 -0400 Subject: [PATCH] Fix death when changing clothes + minor changes removing the Respawn EH fixes this, I haven't noticed any adverse effects from removing it yet. Also changing groups now deletes the old group. The machine which the group is local to must execute the deleteGroup command, the server previously had to wait until the player disconnects to delete their empty groups. --- SQF/dayz_code/compile/player_humanityMorph.sqf | 3 +-- SQF/dayz_code/compile/player_switchModel.sqf | 2 ++ SQF/dayz_code/system/player_monitor.fsm | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/SQF/dayz_code/compile/player_humanityMorph.sqf b/SQF/dayz_code/compile/player_humanityMorph.sqf index 085966d1d..f77dd93a6 100644 --- a/SQF/dayz_code/compile/player_humanityMorph.sqf +++ b/SQF/dayz_code/compile/player_humanityMorph.sqf @@ -27,8 +27,7 @@ _friendlies = player getVariable ["friendlies",[]]; _tagSetting = player getVariable ["DZE_display_name",false]; //Switch -_switch = _model spawn player_switchModel; -waitUntil { scriptDone _switch }; +_model call player_switchModel; //Already spawned thread, no need to spawn and waitUntil script is done //Login diff --git a/SQF/dayz_code/compile/player_switchModel.sqf b/SQF/dayz_code/compile/player_switchModel.sqf index c218e7b56..247586213 100644 --- a/SQF/dayz_code/compile/player_switchModel.sqf +++ b/SQF/dayz_code/compile/player_switchModel.sqf @@ -54,6 +54,7 @@ if (count _muzzles > 1) then {_currentWpn = currentMuzzle player;}; _display = findDisplay 106; _display closeDisplay 0; +_oldGroup = group player; //BackUp Player Object _oldUnit = player; @@ -151,6 +152,7 @@ _newUnit setPosATL _position; removeAllWeapons _oldUnit; {_oldUnit removeMagazine _x;} count magazines _oldUnit; if !(isNull _oldUnit) then {deleteVehicle _oldUnit;}; +deleteGroup _oldGroup; // player switchCamera = _currentCamera; if (_currentWpn != "") then {_newUnit selectWeapon _currentWpn;}; diff --git a/SQF/dayz_code/system/player_monitor.fsm b/SQF/dayz_code/system/player_monitor.fsm index 235f75217..59a5c467a 100644 --- a/SQF/dayz_code/system/player_monitor.fsm +++ b/SQF/dayz_code/system/player_monitor.fsm @@ -1058,7 +1058,7 @@ class FSM "player disableConversation true;" \n "" \n "eh_player_killed = player addeventhandler [""FiredNear"",{_this call player_weaponFiredNear;} ];" \n - "player addEventHandler ['Respawn', player_death];" \n + "//player addEventHandler ['Respawn', player_death];" \n "" \n "//_state = player getVariable[""state"",[]];" \n "_currentWpn = """";" \n