Added range check to SendTileSquare

This commit is contained in:
Deathmax 2011-07-06 22:03:17 +08:00
parent f3e3c4dafc
commit ecc6da2a96

View file

@ -204,6 +204,8 @@ namespace TShockAPI
public virtual void SendTileSquare(int x, int y, int size = 10)
{
if (x + size >= Main.maxTilesX || y + size >= Main.maxTilesX)
return;
SendData(PacketTypes.TileSendSquare, "", size, (float)(x - (size / 2)), (float)(y - (size / 2)), 0f);
}