From 923aa66694a691410fc57a5e2ae80493859fbc87 Mon Sep 17 00:00:00 2001 From: high Date: Tue, 28 Jun 2011 10:41:09 -0400 Subject: [PATCH] Re-added null check. Removed bounds checks (not needed) --- TShockAPI/GetDataHandlers.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/TShockAPI/GetDataHandlers.cs b/TShockAPI/GetDataHandlers.cs index 5528ee52..94bd517f 100755 --- a/TShockAPI/GetDataHandlers.cs +++ b/TShockAPI/GetDataHandlers.cs @@ -397,10 +397,10 @@ namespace TShockAPI private static bool HandlePlayerDamage(GetDataHandlerArgs args) { byte playerid = args.Data.ReadInt8(); - if (playerid >= 0 && playerid <= Main.maxPlayers) - return !TShock.Players[playerid].TPlayer.hostile; - else + if (TShock.Players[playerid] == null) return true; + + return !TShock.Players[playerid].TPlayer.hostile; } private static bool HandleLiquidSet(GetDataHandlerArgs args)