@@ -120,19 +120,24 @@ 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.WillowPlayerController:FinishSaveGameLoad" , immediately_enable = True )
124- def end_load_game (_1 : UObject , args : WrappedStruct , _3 : Any , _4 : BoundFunction ) -> None : # noqa: D103
125- # We hook this to send data back to any registered mod save options. This gets called when
126- # loading character in main menu also. No callback here because the timing of when this is
127- # called doesn't make much sense to do anything with it. See hook on LoadPlayerSaveGame.
128-
129- # Often we'll load a save from a character with no save data. We'll set all save options
130- # to default first to cover for any missing data.
123+ @hook ("WillowGame.WillowPlayerController:LoadGame" , immediately_enable = True )
124+ def load_game (* _ : Any ) -> None : # noqa: D103
125+ # We hook this to set all options to default whenever a new character is loaded. This covers
126+ # both new characters and existing. Characters with existing save options will have their
127+ # options set in the EndLoadGame hook.
131128 for mod_save_options in registered_save_options .values ():
132129 for save_option in mod_save_options .values ():
133130 set_option_to_default (save_option )
134131
135- save_game = args .SaveGame
132+
133+ @hook ("WillowGame.WillowSaveGameManager:EndLoadGame" , Type .POST , immediately_enable = True )
134+ def end_load_game (_1 : UObject , _2 : WrappedStruct , ret : Any , _4 : BoundFunction ) -> None : # noqa: D103
135+ # We hook this to send data back to any registered mod save options. This gets called when
136+ # loading character in main menu also. No callback here because the timing of when this is
137+ # called doesn't make much sense to do anything with it. See hook on LoadPlayerSaveGame.
138+
139+ # This function returns the new save game object, so use a post hook and grab it from `ret`
140+ save_game = ret
136141 if not save_game :
137142 return
138143 extracted_save_data = _extract_save_data (save_game .UnloadableDlcLockoutList )
0 commit comments