diff --git a/SQF/dayz_code/compile/player_humanityMorph.sqf b/SQF/dayz_code/compile/player_humanityMorph.sqf index abd2df70b..4f4da103c 100644 --- a/SQF/dayz_code/compile/player_humanityMorph.sqf +++ b/SQF/dayz_code/compile/player_humanityMorph.sqf @@ -91,4 +91,8 @@ player addWeapon "Loot"; player addWeapon "Flare"; sleep 0.1; -deleteVehicle _old; \ No newline at end of file + +if (!isNull _old) then { + // this should not be needed as player is deleted in player_switchModel? + deleteVehicle _old; +}; diff --git a/SQF/dayz_code/init/compiles.sqf b/SQF/dayz_code/init/compiles.sqf index 802325eea..10b79565f 100644 --- a/SQF/dayz_code/init/compiles.sqf +++ b/SQF/dayz_code/init/compiles.sqf @@ -268,7 +268,7 @@ if (!isDedicated) then { _handled = false; if (_dikCode in[0x58,0x57,0x44,0x43,0x42,0x41,0x40,0x3F,0x3E,0x3D,0x3C,0x3B,0x0B,0x0A,0x09,0x08,0x07,0x06,0x05]) then { - _handled = true; + _handled = true; }; if (_dikCode in actionKeys "MoveForward") exitWith {r_interrupt = true}; @@ -312,7 +312,7 @@ if (!isDedicated) then { }; if (_dikCode in actionKeys "ForceCommandingMode") then {_handled = true}; - if (_dikCode in actionKeys "PushToTalk" and (diag_tickdiag_tickTime - dayz_lastCheckBit > 10)) then { + if (_dikCode in actionKeys "PushToTalk" and (diag_tickTime - dayz_lastCheckBit > 10)) then { dayz_lastCheckBit = diag_tickTime; [player,50,true,(getPosATL player)] spawn player_alertZombies; }; @@ -395,6 +395,20 @@ if (!isDedicated) then { _handled }; + player_setDate = { + private ["_setdatebool","_forEachIndex","_newdate","_n"]; + _setdatebool = false; + _n = _this; + { + if (_x != (_n select _forEachIndex)) exitWith { + _setdatebool = true; + }; + } forEach date; + if (_setdatebool) then { + setDate _newdate; + }; + }; + player_serverModelChange = { private["_object","_model"]; _object = _this select 0; diff --git a/SQF/dayz_code/init/publicEH.sqf b/SQF/dayz_code/init/publicEH.sqf index fa8b18e38..f3f81f7f3 100644 --- a/SQF/dayz_code/init/publicEH.sqf +++ b/SQF/dayz_code/init/publicEH.sqf @@ -58,7 +58,7 @@ if (isServer) then { //Client only if (!isDedicated) then { - "PVDZE_plr_SetDate" addPublicVariableEventHandler {setDate (_this select 1)}; + "PVDZE_plr_SetDate" addPublicVariableEventHandler {(_this select 1) call player_setDate}; "PVDZE_obj_RoadFlare" addPublicVariableEventHandler {(_this select 1) spawn object_roadFlare}; "PVDZE_plr_Morph2" addPublicVariableEventHandler {(_this select 1) call player_serverModelChange}; "PVDZE_plr_Morph" addPublicVariableEventHandler {(_this select 1) call server_switchPlayer};