JavidPack / RecipeBrowser

RecipeBrowser mod for tModLoader
https://forums.terraria.org/index.php?threads/recipe-browser.62462/
80 stars 51 forks source link

Index was outside the bounds of the array in RecipeBrowser.LootCacheManager.Setup #29

Closed hiddenwolfe closed 5 years ago

hiddenwolfe commented 5 years ago

Keeps giving me this error Index was outside the bounds of the array. at RecipeBrowser.LootCacheManager.Setup(Mod recipeBrowserMod) in D:\Documents\My Games\Terraria/ModLoader\Mod Sources\RecipeBrowser\LootCache.cs:line 372 at RecipeBrowser.RecipeBrowser.PostAddRecipes() in D:\Documents\My Games\Terraria/ModLoader\Mod Sources\RecipeBrowser\RecipeBrowser.cs:line 169 at Terraria.ModLoader.RecipeHooks.PostAddRecipes() seems to be due to "D:\Documents\My Games\Terraria/ModLoader\Mod Sources\RecipeBrowser\LootCache.cs:line 372" not being a proper place to go to becuase of terraria\ Also had issues with 0.7 and thorium but if I disable with 0.8 thorium it still crashed.

hiddenwolfe commented 5 years ago

I tried putting the the folder there that you was in the .zip and it still gives the same error.

JavidPack commented 5 years ago

Those paths in the error messages are for my benefit, so I can check the line of code that caused the error. It has nothing to do with the files on your computer.

As for this error, I don't know why but it just started happening with some people in recent weeks. It doesn't make sense that the mod or tmod would suddenly change behavior, but the other person I had test the mod claimed they had no other mods or changes to tmodloader made recently.

I've attached a build of the mod that the other person claimed fixed the problem, not sure why. If it still crashes when you use this mod, post the contents of "\Documents\My Games\Terraria\ModLoader\Logs\Logs.txt" as I've added some lines of debug logging to this build, that might help me figure out why the mod is acting up lately.

RecipeBrowser.zip

JavidPack commented 5 years ago

To add to this issue, someone else with this problem reported the following:

1: 1 2: 1200 3: 1 4: 1200

while a normal Terraria should report

1: 8401 2: 2401 3: 8401 4: 2401

Something is messing up the values for maxTilesX and Y for that user, cause is still unknown

hiddenwolfe commented 5 years ago

Thanks for the response, I'm going to check to see if it works now.

hiddenwolfe commented 5 years ago

OK it's still crashing. Here is the log.

Initialized translations with 287 lines. Initialized translations with 287 lines. 1: 1 2: 1200 3: 1 4: 1200

hiddenwolfe commented 5 years ago

Ok I got it working. by using Tmod loader to delete the mod and then putting the file you gave me back in the mods folder it worked. But by just deleting recipebrowser.tmod manually and putting it back does not work.

JavidPack commented 5 years ago

I just replicated the problem by installing Terraria Overhaul and then disabling the mod. I guess just wait for a fix to Overhaul to remove this code:

Main.maxTilesX = 1;
Main.maxTilesY = 1200;

In the meantime, anyone using that mod please refrain from reloading mods after leaving a world. If you need to change mods and Overhaul is enabled, enable or disable mods and then restart tmodloader.