Nirv-git / CVRMods-Nirv

8 stars 2 forks source link

[PortableMirror] Errors during mod initialization #2

Closed kafeijao closed 1 year ago

kafeijao commented 1 year ago

image

I'm getting some errors during other mods initialization, I was looking for the issue at it seems it happens when OnPreferencesSaved is called (because another mod saved prefs for example) and PortableMirror's OnApplicationStart wasn't called yet.

The NullReferenceException is coming from https://github.com/Nirv-git/CVRMods-Nirv/blob/c4f50d11cb858a2d0366e0655801da3d985cea93/PortableMirror_Combined/Main.cs#L249

Because distanceDisable was not initialized yet.

Nirv-git commented 1 year ago

Bah, why must some mods call a global OnPrefSave on init, if they want they can just call their own OnPrefSav method.

Will fix in next version

NotAKidoS commented 1 year ago

heh- all my mods used to save preferences on startup

sdraw chewed me out for that~