tModLoader

tModLoader

MultiMap World(Beta)
boo! 10 月 5 日 上午 7:04
Crash when entering newly generated world - NullReferenceException
The game crashes when I try to enter a freshly generated MultiWorld for the first time. World generation completes successfully, but crashes during player spawn.

Error:
System.NullReferenceException: Object reference not set to an instance of an object.
at MultiWorld.Common.Systems.WorldManageSystem.OnIsBiomeActive

The problem: In WorldManageSystem.cs line 118, the code tries to access worldsystem.metaData.GenMode but metaData is null during the initial spawn because it hasn't been loaded yet.

I tried to fix it by adding a null check like this one:
if (worldsystem.metaData != null && worldsystem.metaData.GenMode == "Random Mod")

But couldn't get dnspy to compile it, if needed I can share the enabled mods I have if that can help.