diff --git a/scripts/_00e_autosavesystem_functions.pex b/scripts/_00e_autosavesystem_functions.pex index 8f92b475..39de2ed0 100644 Binary files a/scripts/_00e_autosavesystem_functions.pex and b/scripts/_00e_autosavesystem_functions.pex differ diff --git a/source/scripts/_00e_autosavesystem_functions.psc b/source/scripts/_00e_autosavesystem_functions.psc index 309dd5ea..f4caec0e 100644 --- a/source/scripts/_00e_autosavesystem_functions.psc +++ b/source/scripts/_00e_autosavesystem_functions.psc @@ -14,14 +14,10 @@ Scriptname _00E_AutoSaveSystem_Functions extends Quest ; 1: Unknown flag. Event OnUpdate() - - If bAutosaveSystemStopped - return - EndIf Actor PlayerREF = Game.GetForm(0x14) as Actor - If PlayerREF.IsInCombat() || ! Game.IsFightingControlsEnabled() || PlayerREF.IsDead() || Utility.IsInMenuMode() || UI.IsTextInputEnabled() || UI.IsMenuOpen("Dialogue Menu") + If PlayerREF.IsInCombat() || PlayerREF.IsOnMount() || PlayerREF.IsSwimming() || ! Game.IsFightingControlsEnabled() || PlayerREF.IsDead() || Utility.IsInMenuMode() || UI.IsTextInputEnabled() || UI.IsMenuOpen("Dialogue Menu") RegisterForSingleUpdate(5) return endif @@ -41,42 +37,20 @@ EndEvent ; called from _00E_AutosaveIntervalAlias to update ini setting fAutosaveEveryXMins in case it was changed Function UpdateAutoSaveInterval() - fUpdateTime = GetAutosaveEveryXMins() + if SKSE.GetVersion() <= 0 + UnregisterForUpdate() + return + endif + + fUpdateTime = Utility.GetIniFloat("fAutosaveEveryXMins:SaveGame") + + If fUpdateTime <= 0.0 ; just in case + fUpdateTime = 30 + EndIf + RegisterForSingleUpdate(fUpdateTime*60) EndFunction -Function StopAutosaveSystem() - bAutosaveSystemStopped = true - UnregisterForUpdate() -EndFunction - -Function ResumeAutosaveSystemInXMinutes(float _fMinutes = 0.0) - - If _fMinutes == 0.0 - _fMinutes = fUpdateTime - If _fMinutes <= 0.0 ; just in case - _fMinutes = 30 - EndIf - EndIf - - RegisterForSingleUpdate(_fMinutes*60) - bAutosaveSystemStopped = false - -EndFunction - -float function GetAutosaveEveryXMins() - - float fUpdateMinutes = Utility.GetIniFloat("fAutosaveEveryXMins:SaveGame") - - If fUpdateMinutes <= 0.0 ; just in case - fUpdateMinutes = 30 - EndIf - - return fUpdateMinutes - -endfunction - -bool bAutosaveSystemStopped = false int iAutosaveIndex = 0 float fUpdateTime