Don't log IndexOutOfRange exceptions in SendTileSquare
This commit is contained in:
parent
a8ac9435fd
commit
ab55481ddb
1 changed files with 19 additions and 15 deletions
|
|
@ -308,22 +308,26 @@ namespace TShockAPI
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual bool SendTileSquare(int x, int y, int size = 10)
|
public virtual bool SendTileSquare(int x, int y, int size = 10)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
int num = (size - 1)/2;
|
int num = (size - 1)/2;
|
||||||
SendData(PacketTypes.TileSendSquare, "", size, (x - num), (y - num));
|
SendData(PacketTypes.TileSendSquare, "", size, (x - num), (y - num));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (IndexOutOfRangeException)
|
||||||
{
|
{
|
||||||
Log.Error(ex.ToString());
|
// This is expected if square exceeds array.
|
||||||
}
|
}
|
||||||
return false;
|
catch (Exception ex)
|
||||||
}
|
{
|
||||||
|
Log.Error(ex.ToString());
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public virtual void GiveItem(int type, string name, int width, int height, int stack, int prefix = 0)
|
public virtual void GiveItem(int type, string name, int width, int height, int stack, int prefix = 0)
|
||||||
{
|
{
|
||||||
int itemid = Item.NewItem((int) X, (int) Y, width, height, type, stack, true, prefix);
|
int itemid = Item.NewItem((int) X, (int) Y, width, height, type, stack, true, prefix);
|
||||||
// This is for special pickaxe/hammers/swords etc
|
// This is for special pickaxe/hammers/swords etc
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue