Move the code to pull all items from the db outside of the if file exists loop.

TSDEV-46
This commit is contained in:
Zack Piispanen 2011-07-22 17:06:58 -04:00
parent 7f2ff7614f
commit 2c2097dc08

View file

@ -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;