Skip to content

Commit

Permalink
More multi-thread exception detection
Browse files Browse the repository at this point in the history
  • Loading branch information
blushiemagic committed Oct 23, 2017
1 parent 9fd5e18 commit 6ad7989
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
15 changes: 9 additions & 6 deletions CraftingGUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ private static void InitFilterButtons()
}

public static void Update(GameTime gameTime)
{
{try{
oldMouse = StorageGUI.oldMouse;
curMouse = StorageGUI.curMouse;
if (Main.playerInventory && Main.player[Main.myPlayer].GetModPlayer<StoragePlayer>(MagicStorage.Instance).ViewingStorage().X >= 0 && StoragePlayer.IsStorageCrafting())
Expand All @@ -433,11 +433,11 @@ public static void Update(GameTime gameTime)
craftTimer = 0;
maxCraftTimer = startMaxCraftTimer;
ResetSlotFocus();
}
}}catch(Exception e){Main.NewTextMultiline(e.ToString());}
}

public static void Draw(TEStorageHeart heart)
{
{try{
Player player = Main.player[Main.myPlayer];
StoragePlayer modPlayer = player.GetModPlayer<StoragePlayer>(MagicStorage.Instance);
Initialize();
Expand All @@ -461,7 +461,7 @@ public static void Draw(TEStorageHeart heart)
resultZone.DrawText();
sortButtons.DrawText();
recipeButtons.DrawText();
filterButtons.DrawText();
filterButtons.DrawText();}catch(Exception e){Main.NewTextMultiline(e.ToString());}
}

private static Item GetStation(int slot, ref int context)
Expand Down Expand Up @@ -805,7 +805,7 @@ public static void RefreshItems()
private static void RefreshRecipes()
{
while (true)
{
{try{
SortMode sortMode;
FilterMode filterMode;
lock (threadLock)
Expand Down Expand Up @@ -833,6 +833,9 @@ private static void RefreshRecipes()
catch (InvalidOperationException)
{
}
catch (KeyNotFoundException)
{
}
lock (recipeLock)
{
nextRecipes = new List<Recipe>();
Expand All @@ -848,7 +851,7 @@ private static void RefreshRecipes()
threadRunning = false;
return;
}
}
}}catch(Exception e){Main.NewTextMultiline(e.ToString());}
}
}

Expand Down
2 changes: 1 addition & 1 deletion build.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
author = blushiemagic
version = 0.4.3
version = 0.4.3.1
displayName = Magic Storage
homepage = https://forums.terraria.org/index.php?threads/magic-storage.56294/
hideCode = false
Expand Down

0 comments on commit 6ad7989

Please sign in to comment.