From 0b26ae12463d0c49b5bad27105a53ba37203c33f Mon Sep 17 00:00:00 2001 From: AirwavesMan Date: Sun, 13 Sep 2020 15:18:17 +0200 Subject: [PATCH] Fix potential kills doubling after change clothes Fix by @seelenapparat --- SQF/dayz_code/compile/player_humanityMorph.sqf | 10 +++++----- SQF/dayz_code/compile/player_switchModel.sqf | 4 ++++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/SQF/dayz_code/compile/player_humanityMorph.sqf b/SQF/dayz_code/compile/player_humanityMorph.sqf index 9f39ab71f..50494bddc 100644 --- a/SQF/dayz_code/compile/player_humanityMorph.sqf +++ b/SQF/dayz_code/compile/player_humanityMorph.sqf @@ -37,7 +37,7 @@ if (Z_SingleCurrency) then { }; //Switch -[_model, _charID, _humanity] call player_switchModel; //Already spawned thread, no need to spawn and waitUntil script is done +[_model, _charID, _humanity, _zombieKills, _headShots, _humanKills, _banditKills] call player_switchModel; //Already spawned thread, no need to spawn and waitUntil script is done //Login @@ -81,10 +81,10 @@ if (count _medical > 0) then { //General Stats //player setVariable ["humanity",_humanity,true]; //Moved to player_switchModel -player setVariable ["zombieKills",_zombieKills,true]; -player setVariable ["headShots",_headShots,true]; -player setVariable ["humanKills",_humanKills,true]; -player setVariable ["banditKills",_banditKills,true]; +//player setVariable ["zombieKills",_zombieKills,true]; //Moved to player_switchModel +//player setVariable ["headShots",_headShots,true]; //Moved to player_switchModel +//player setVariable ["humanKills",_humanKills,true]; //Moved to player_switchModel +//player setVariable ["banditKills",_banditKills,true]; //Moved to player_switchModel //player setVariable ["characterID",_charID,true]; //Moved to player_switchModel player setVariable ["worldspace",_worldspace]; player setVariable ["combattimeout",_combattimeout,false]; diff --git a/SQF/dayz_code/compile/player_switchModel.sqf b/SQF/dayz_code/compile/player_switchModel.sqf index 161894b3b..4ad0e00cd 100644 --- a/SQF/dayz_code/compile/player_switchModel.sqf +++ b/SQF/dayz_code/compile/player_switchModel.sqf @@ -75,6 +75,10 @@ if (_isArray) then { mydamage_eh1 = _newUnit AddEventHandler ["HandleDamage", {False}]; _newUnit setVariable ["characterID",(_this select 1),true]; _newUnit setVariable ["humanity",(_this select 2),true]; + _newUnit setVariable ["zombieKills",(_this select 3),true]; + _newUnit setVariable ["headShots",(_this select 4),true]; + _newUnit setVariable ["humanKills",(_this select 5),true]; + _newUnit setVariable ["banditKills",(_this select 6),true]; }; _newUnit setDir _dir; {_newUnit removeMagazine _x;} count magazines _newUnit;