Skip to content

Commit 5d5d70c

Browse files
committed
Fix issue with newly created characters inheriting values from previous
1 parent 98ef2b0 commit 5d5d70c

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/save_options/hooks.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,21 +120,19 @@ def save_game(_1: UObject, args: WrappedStruct, _3: Any, _4: BoundFunction) -> N
120120
save_options.options.any_option_changed = False
121121

122122

123-
@hook("WillowGame.WillowSaveGameManager:EndLoadGame", Type.POST, immediately_enable=True)
124-
def end_load_game(_1: UObject, _2: WrappedStruct, ret: Any, _4: BoundFunction) -> None: # noqa: D103
123+
@hook("WillowGame.WillowPlayerController:FinishSaveGameLoad", immediately_enable=True)
124+
def end_load_game(_1: UObject, args: WrappedStruct, _3: Any, _4: BoundFunction) -> None: # noqa: D103
125125
# We hook this to send data back to any registered mod save options. This gets called when
126126
# loading character in main menu also. No callback here because the timing of when this is
127127
# called doesn't make much sense to do anything with it. See hook on LoadPlayerSaveGame.
128128

129129
# Often we'll load a save from a character with no save data. We'll set all save options
130130
# to default first to cover for any missing data.
131-
132131
for mod_save_options in registered_save_options.values():
133132
for save_option in mod_save_options.values():
134133
set_option_to_default(save_option)
135134

136-
# This function returns the new save game object, so use a post hook and grab it from `ret`
137-
save_game = ret
135+
save_game = args.SaveGame
138136
if not save_game:
139137
return
140138
extracted_save_data = _extract_save_data(save_game.UnloadableDlcLockoutList)

0 commit comments

Comments
 (0)