Skip to content

Commit

Permalink
Refresh registrations on game load
Browse files Browse the repository at this point in the history
  • Loading branch information
pragasette committed Feb 3, 2020
1 parent d5208e6 commit 7c6a22a
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
The format is based on [Keep a Changelog], and this project adheres to
[Semantic Versioning].

## Unreleased

### Fixed

- Health was not reverted after level up in loaded games, this apparently
affected only Skyrim Special Edition.

## [1.0.0] - 2019-12-18

### Added
Expand Down
Binary file modified No Health Reset.esp
Binary file not shown.
7 changes: 7 additions & 0 deletions Scripts/Source/_p7NHR_PlayerAlias.psc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Scriptname _p7NHR_PlayerAlias extends ReferenceAlias

_p7NHR_Quest Property PlayerQuest Auto

Event OnPlayerLoadGame()
PlayerQuest.RefreshRegistrations()
EndEvent
14 changes: 10 additions & 4 deletions Scripts/Source/_p7NHR_Quest.psc
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ Float controlBaseHealth
Float sleepStart

Event OnInit()
RegisterForSleep()

; requires SKSE >= 1.06.00
RegisterForMenu("LevelUp Menu")
RefreshRegistrations()
EndEvent

Event OnSleepStart(Float afSleepStartTime, Float afDesiredSleepEndTime)
Expand Down Expand Up @@ -79,6 +76,15 @@ Event OnMenuClose(String MenuName)
EndIf
EndEvent

Function RefreshRegistrations()
UnregisterForSleep()
UnregisterForAllMenus()

RegisterForSleep()
; requires SKSE >= 1.6.0
RegisterForMenu("LevelUp Menu")
EndFunction

Function Log(String text)
Debug.Trace("[No Health Reset] " + text)
EndFunction

0 comments on commit 7c6a22a

Please sign in to comment.