Code cleanup thanks to High6

This commit is contained in:
Lucas Nicodemus 2011-07-14 18:21:43 -06:00
parent d45c7a5753
commit 485bc61fac

View file

@ -152,16 +152,10 @@ namespace TShockAPI.DB
{
com.CommandText = "UPDATE Regions SET Protected=@bool WHERE RegionName=@name AND WorldID=@worldid";
com.AddParameter("@name", name);
if (state)
com.AddParameter("@bool", 1);
else
com.AddParameter("@bool", 0);
com.AddParameter("@bool", state ? 1 : 0);
com.AddParameter("@worldid", Main.worldID.ToString());
ReloadAllRegions();
if (com.ExecuteNonQuery() > 0)
return true;
else
return false;
return (com.ExecuteNonQuery() > 0);
}
}
catch (Exception ex)