kernel-panic-codecave / Multiverse2

GNU General Public License v3.0
0 stars 3 forks source link

Disabled on loading #2

Closed Manaether closed 2 years ago

Manaether commented 2 years ago

Terraria version : 1.4.3.6 TModLoader version : Stable build 2022.3.35.3 How to reproduce : install mod with dependency from workshop and reload terraria after enabling the mods

[18:59:25] [.NET ThreadPool Worker/INFO] [tML]: Initializing: Multiverse2 (Multiverse 2) v2.1.0
[18:59:25] [.NET ThreadPool Worker/WARN] [tML]: Silently Caught Exception: 
System.NullReferenceException: Object reference not set to an instance of an object.
   at Multiverse2.Content.Subworlds.MultiverseSystem.OnModLoad() in Multiverse2\Content\Subworlds\MultiverseSystem.cs:line 20
   at Terraria.ModLoader.SystemLoader.OnModLoad(Mod mod) in tModLoader\Terraria\ModLoader\SystemLoader.cs:line 66
   at Terraria.ModLoader.ModContent.<>c.<Load>b__41_0(Mod mod) in tModLoader\Terraria\ModLoader\ModContent.cs:line 306
   at Terraria.ModLoader.ModContent.LoadModContent(CancellationToken token, Action`1 loadAction) in tModLoader\Terraria\ModLoader\ModContent.cs:line 360
   at Terraria.ModLoader.ModContent.Load(CancellationToken token) in tModLoader\Terraria\ModLoader\ModContent.cs:line 299
   at Terraria.ModLoader.ModLoader.Load(CancellationToken token) in tModLoader\Terraria\ModLoader\ModLoader.cs:line 123
   at Terraria.ModLoader.ModLoader.<>c__DisplayClass44_0.<BeginLoad>b__0() in tModLoader\Terraria\ModLoader\ModLoader.cs:line 105
   at System.Threading.Tasks.Task.InnerInvoke()
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
   at System.Threading.Thread.StartCallback()

[18:59:25] [.NET ThreadPool Worker/ERROR] [tML]: An error occurred while loading Multiverse2
The mod(s) have been automatically disabled.
System.NullReferenceException: Object reference not set to an instance of an object.
   at Multiverse2.Content.Subworlds.MultiverseSystem.OnModLoad() in Multiverse2\Content\Subworlds\MultiverseSystem.cs:line 20
   at Terraria.ModLoader.SystemLoader.OnModLoad(Mod mod) in tModLoader\Terraria\ModLoader\SystemLoader.cs:line 66
   at Terraria.ModLoader.ModContent.<>c.<Load>b__41_0(Mod mod) in tModLoader\Terraria\ModLoader\ModContent.cs:line 306
   at Terraria.ModLoader.ModContent.LoadModContent(CancellationToken token, Action`1 loadAction) in tModLoader\Terraria\ModLoader\ModContent.cs:line 360
   at Terraria.ModLoader.ModContent.Load(CancellationToken token) in tModLoader\Terraria\ModLoader\ModContent.cs:line 299
   at Terraria.ModLoader.ModLoader.Load(CancellationToken token) in tModLoader\Terraria\ModLoader\ModLoader.cs:line 123
[18:59:25] [.NET ThreadPool Worker/INFO] [tML]: Disabling Mod: Multiverse2
[19:01:13] [Main Thread/DEBUG] [tML]: Process.Start (UseShellExecute = True): "tModLoader-Logs" 
1joachim1 commented 2 years ago

can confirm i had the same exact issue.

there's no problem at activating the library "subworld library" the issue comes straight at activating the multiverse mod itself

and just if needed:

Terraria version : 1.4.3.6

TModLoader version : Stable build 2022.3.35.3

How to reproduce : install mod with dependency from workshop and reload terraria after enabling the mods, restarting terraria with mod manually enabled causes the same error too and disables it automatically.

Extra info: checking the files integrity doesn't help either. everything checks as good.

since the last user pasted the error itself i'm pasting all the client.log file just in case it helps.

client.log

KP2048 commented 2 years ago

hrm. i wonder if it breaks when there are no worlds configured?

KP2048 commented 2 years ago

Try putting this in ModConfigs and see if it loads Multiverse2_MultiverseConfig.zip extract it of course

KP2048 commented 2 years ago

maybe

ModContent.GetInstance<MultiverseConfig>().Worlds

is null when there is no worlds configured? that's kind of odd but there isn't much else in that function that could be null if putting a config file with some worlds configured fixes this, then I'll add a null check so it doesn't have a stroke

KP2048 commented 2 years ago

i can confirm that this is the case. i will send out a patch for this shortly.

Manaether commented 2 years ago

Issues fixed with last update

Thanks @Witherking25