Wrap usages of TShock.Players[] with checks for out of bounds.

This commit is contained in:
Zack Piispanen 2013-10-22 02:37:19 -04:00
parent cd13cc97aa
commit 229d2bf990
2 changed files with 12 additions and 3 deletions

View file

@ -258,7 +258,7 @@ namespace TShockAPI
return found;
byte plrID;
if (byte.TryParse(plr, out plrID))
if (byte.TryParse(plr, out plrID) && plrID < Main.maxPlayers)
{
TSPlayer player = TShock.Players[plrID];
if (player != null && player.Active)