From 3d0c5b13cf367c1fb9309b18be8dbe79918aa3e0 Mon Sep 17 00:00:00 2001 From: ebaydayz Date: Sat, 17 Sep 2016 17:43:41 -0400 Subject: [PATCH] Fix playerSync error from 5f0c2fc @icomrade There are cases where playerSync will receive > 3 params if achievements are passed. Example: https://github.com/EpochModTeam/DayZ-Epoch/blob/master/SQF/dayz_code/system/player_spawn_2.sqf#L305 --- SQF/dayz_server/compile/server_onPlayerDisconnect.sqf | 2 +- SQF/dayz_server/compile/server_playerSync.sqf | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/SQF/dayz_server/compile/server_onPlayerDisconnect.sqf b/SQF/dayz_server/compile/server_onPlayerDisconnect.sqf index fbd6a0c75..f3b95176a 100644 --- a/SQF/dayz_server/compile/server_onPlayerDisconnect.sqf +++ b/SQF/dayz_server/compile/server_onPlayerDisconnect.sqf @@ -50,7 +50,7 @@ if (_characterID != "?") exitwith { //if player object is alive lets sync the player and remove the body and if ghosting is active add the player id to the array if (alive _playerObj) then { // High priority. Sync must finish fast before player object isNull - [_playerObj,nil,true,_inCombat] call server_playerSync; + [_playerObj,nil,true,[],_inCombat] call server_playerSync; /* Low priority code below this point where diff --git a/SQF/dayz_server/compile/server_playerSync.sqf b/SQF/dayz_server/compile/server_playerSync.sqf index c478c49c8..9d2231221 100644 --- a/SQF/dayz_server/compile/server_playerSync.sqf +++ b/SQF/dayz_server/compile/server_playerSync.sqf @@ -148,8 +148,8 @@ if (_currentModel == _modelChk) then { _currentModel = str _currentModel; _character setVariable ["model_CHK",typeOf _character]; }; -if (count _this > 3) then { //calling from player_onDisconnect - if (_this select 3 > 0) then { //combat logged +if (count _this > 4) then { //calling from player_onDisconnect + if (_this select 4 > 0) then { //combat logged _character setVariable ["NORRN_unconscious",true,true]; // Set status to unconscious _character setVariable ["unconsciousTime",150,true]; // Set knock out timer to 2 minutes 30 seconds //_character setVariable ["USEC_injured",true]; // Set status to bleeding