From 9cc3c82d5d6f82a852a5fc94dd51421f2b076502 Mon Sep 17 00:00:00 2001 From: icomrade Date: Tue, 1 Aug 2017 19:34:15 -0400 Subject: [PATCH] set humanity early --- SQF/dayz_code/compile/player_humanityMorph.sqf | 6 +++--- SQF/dayz_code/compile/player_switchModel.sqf | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/SQF/dayz_code/compile/player_humanityMorph.sqf b/SQF/dayz_code/compile/player_humanityMorph.sqf index 2a9b3d462..cf31efe35 100644 --- a/SQF/dayz_code/compile/player_humanityMorph.sqf +++ b/SQF/dayz_code/compile/player_humanityMorph.sqf @@ -39,7 +39,7 @@ if (Z_SingleCurrency) then { }; //Switch -[_model, _charID] call player_switchModel; //Already spawned thread, no need to spawn and waitUntil script is done +[_model, _charID, _humanity] call player_switchModel; //Already spawned thread, no need to spawn and waitUntil script is done //Login @@ -113,7 +113,7 @@ player removeEventHandler ["HandleDamage",mydamage_eh1]; eh_player_killed = player addeventhandler ["FiredNear",{_this call player_weaponFiredNear;}]; [player] call fnc_usec_damageHandle; player allowDamage true; -call player_forceSave; uiSleep 0.1; -if !(isNull _old) then {deleteVehicle _old;}; \ No newline at end of file +if !(isNull _old) then {deleteVehicle _old;}; +call player_forceSave; \ No newline at end of file diff --git a/SQF/dayz_code/compile/player_switchModel.sqf b/SQF/dayz_code/compile/player_switchModel.sqf index b60e8807b..56f766b2f 100644 --- a/SQF/dayz_code/compile/player_switchModel.sqf +++ b/SQF/dayz_code/compile/player_switchModel.sqf @@ -1,8 +1,7 @@ -private ["_weapons","_isArray","_CID","_backpackWpn","_backpackMag","_currentWpn","_isWeapon","_backpackWpnTypes","_backpackWpnQtys","_countr","_class","_position","_dir","_currentAnim","_playerUID","_countMags","_magazines","_primweapon","_secweapon","_newBackpackType","_muzzles","_oldUnit","_group","_newUnit","_oldGroup","_idc","_display","_switchUnit","_leader","_currentCamera"]; +private ["_weapons","_isArray","_backpackWpn","_backpackMag","_currentWpn","_isWeapon","_backpackWpnTypes","_backpackWpnQtys","_countr","_class","_position","_dir","_currentAnim","_playerUID","_countMags","_magazines","_primweapon","_secweapon","_newBackpackType","_muzzles","_oldUnit","_group","_newUnit","_oldGroup","_idc","_display","_switchUnit","_leader","_currentCamera"]; _isArray = typeName _this == "ARRAY"; if (_isArray) then { _class = _this select 0; - _CID = _this select 1; } else { _class = _this; }; @@ -84,7 +83,8 @@ _newUnit = _group createUnit [_class,respawn_west_original,[],0,"NONE"]; if (_isArray) then { _newUnit allowDamage false; mydamage_eh1 = _newUnit AddEventHandler ["HandleDamage", {False}]; - _newUnit setVariable ["characterID",_CID,true]; + _newUnit setVariable ["characterID",(_this select 1),true]; + _newUnit setVariable ["humanity",(_this select 2),true]; }; _newUnit setDir _dir; {_newUnit removeMagazine _x;} count magazines _newUnit;