From 2c2097dc08aacdc975495ce10c6e209fcde81428 Mon Sep 17 00:00:00 2001 From: Zack Piispanen Date: Fri, 22 Jul 2011 17:06:58 -0400 Subject: [PATCH] Move the code to pull all items from the db outside of the if file exists loop. TSDEV-46 --- TShockAPI/DB/ItemManager.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/TShockAPI/DB/ItemManager.cs b/TShockAPI/DB/ItemManager.cs index ce9eeeff..27f640ce 100644 --- a/TShockAPI/DB/ItemManager.cs +++ b/TShockAPI/DB/ItemManager.cs @@ -59,9 +59,10 @@ namespace TShockAPI.DB if (File.Exists(file2)) File.Delete(file2); File.Move(file, file2); - com.CommandText = "SELECT *FROM ItemBans"; } + com.CommandText = "SELECT * FROM ItemBans"; + using (var reader = com.ExecuteReader()) { while (reader.Read()) @@ -108,6 +109,7 @@ namespace TShockAPI.DB public bool ItemIsBanned(string name) { + System.Console.WriteLine(name); if (ItemBans.Contains(name)) return true;