diff --git a/SQF/dayz_code/actions/pickupActions/object_pickup.sqf b/SQF/dayz_code/actions/pickupActions/object_pickup.sqf index 4bf10b9d8..39410c9a3 100644 --- a/SQF/dayz_code/actions/pickupActions/object_pickup.sqf +++ b/SQF/dayz_code/actions/pickupActions/object_pickup.sqf @@ -52,9 +52,8 @@ if (_classname isKindOf "Bag_Base_EP1") exitWith { waitUntil { !isNull (unitBackpack player) }; uiSleep 0.03; - - PVDZ_plr_Save = [player,nil,dayz_onBack]; - publicVariableServer "PVDZ_plr_Save"; + + call player_regularSave; }; _config = (configFile >> _type >> _classname); diff --git a/SQF/dayz_code/actions/player_sleep.sqf b/SQF/dayz_code/actions/player_sleep.sqf index 77e2edeb0..49f4f127a 100644 --- a/SQF/dayz_code/actions/player_sleep.sqf +++ b/SQF/dayz_code/actions/player_sleep.sqf @@ -115,6 +115,5 @@ player setVariable ["sleeping",false]; dayz_actionInProgress = false; //Removed due to player sync returning [] -//PVDZ_plr_Save = [player,nil,true,dayz_playerAchievements]; -//publicVariableServer "PVDZ_plr_Save"; +//call player_regularSave; R3F_TIRED_Accumulator = 0; \ No newline at end of file diff --git a/SQF/dayz_code/actions/pzombie/pz_feed.sqf b/SQF/dayz_code/actions/pzombie/pz_feed.sqf index 5cd6cf9cb..dcc3f2a6f 100644 --- a/SQF/dayz_code/actions/pzombie/pz_feed.sqf +++ b/SQF/dayz_code/actions/pzombie/pz_feed.sqf @@ -63,8 +63,7 @@ if !(alive _item) then { dayz_lastMeal = time; dayz_hunger = 0; - PVDZ_plr_Save = [player,nil,dayz_onBack]; - publicVariableServer "PVDZ_plr_Save"; + call player_regularSave; [player,"eat",0,false] call dayz_zombieSpeak; diff --git a/SQF/dayz_code/compile/player_regularSave.sqf b/SQF/dayz_code/compile/player_regularSave.sqf new file mode 100644 index 000000000..f0605d789 --- /dev/null +++ b/SQF/dayz_code/compile/player_regularSave.sqf @@ -0,0 +1,17 @@ +/* + File: player_regularSave.sqf + Organisation Author: DayZMod Team + + Email: N/A + Creation date: 2020-12-30 17:20:00 + Last modified time: 2020-12-30 17:34:00 + Description: + Requests a simple save for the player object. + Example: + call player_regularSave; + Return: + Nothing +*/ + +PVDZ_plr_Save = [player,nil,dayz_onBack]; +publicVariableServer "PVDZ_plr_Save"; \ No newline at end of file diff --git a/SQF/dayz_code/init/compiles.sqf b/SQF/dayz_code/init/compiles.sqf index c014e8301..8162f7a44 100644 --- a/SQF/dayz_code/init/compiles.sqf +++ b/SQF/dayz_code/init/compiles.sqf @@ -48,6 +48,7 @@ if (!isDedicated) then { player_fireMonitor = compile preprocessFileLineNumbers "\z\addons\dayz_code\system\fire_monitor.sqf"; player_countMagazines = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_countMagazines.sqf"; player_countMagazinesWBackpack = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_countMagazinesWBackpack.sqf"; + player_regularSave = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_regularSave.sqf"; player_forceSave = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_forceSave.sqf"; vehicle_getOut = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\vehicle_getOut.sqf"; diff --git a/SQF/dayz_code/system/player_spawn_2.sqf b/SQF/dayz_code/system/player_spawn_2.sqf index 435938eb7..40def6640 100644 --- a/SQF/dayz_code/system/player_spawn_2.sqf +++ b/SQF/dayz_code/system/player_spawn_2.sqf @@ -260,8 +260,7 @@ while {1 == 1} do { if (dayz_unsaved || {(diag_ticktime - dayz_lastSave) > 300}) then { if ((diag_ticktime - dayz_lastSave) > _saveTime) then { - PVDZ_plr_Save = [player,nil,dayz_onBack]; - publicVariableServer "PVDZ_plr_Save"; + call player_regularSave; dayz_unsaved = false; dayz_lastSave = diag_ticktime; };