From ce38ac189536623334d9bc92ffdb2dd045cbbee9 Mon Sep 17 00:00:00 2001 From: high Date: Tue, 14 Jun 2011 22:52:21 -0400 Subject: [PATCH] Fixed kill tile crash when switching to vector2 --- TShockAPI/TShock.cs | 6 ++++-- TShockAPI/Tools.cs | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs index bffc9a78..46676fa2 100755 --- a/TShockAPI/TShock.cs +++ b/TShockAPI/TShock.cs @@ -37,7 +37,7 @@ namespace TShockAPI public static readonly string SavePath = "tshock"; - public static readonly Version VersionNum = new Version(2, 1, 0, 4); + public static readonly Version VersionNum = new Version(2, 1, 0, 6); public static readonly string VersionCodename = "Forgot to increase the version."; @@ -401,7 +401,9 @@ namespace TShockAPI if (type == 0 && BlacklistTiles[Main.tile[x, y].type] && Main.player[e.Msg.whoAmI].active) { Players[e.Msg.whoAmI].TileThreshold++; - Players[e.Msg.whoAmI].TilesDestroyed.Add(new Vector2(x, y), Main.tile[x, y]); + var coords = new Vector2(x, y); + if (!Players[e.Msg.whoAmI].TilesDestroyed.ContainsKey(coords)) + Players[e.Msg.whoAmI].TilesDestroyed.Add(coords, Main.tile[x, y]); } return false; diff --git a/TShockAPI/Tools.cs b/TShockAPI/Tools.cs index 7103009c..81039087 100755 --- a/TShockAPI/Tools.cs +++ b/TShockAPI/Tools.cs @@ -284,7 +284,7 @@ namespace TShockAPI { return Ban(ply, reason); } - else if (kick) + if (kick) { return Kick(ply, reason); }