Merge remote branch 'k0rd/general-devel' into general-devel
This commit is contained in:
commit
220bcd00b1
1 changed files with 25 additions and 1 deletions
|
|
@ -313,11 +313,35 @@ namespace TShockAPI
|
|||
try
|
||||
{
|
||||
int num = (size - 1)/2;
|
||||
SendData(PacketTypes.TileSendSquare, "", size, (x - num), (y - num));
|
||||
int m_x=0;
|
||||
int m_y=0;
|
||||
|
||||
if (x - num <0){
|
||||
m_x=0;
|
||||
}else{
|
||||
m_x = x - num;
|
||||
}
|
||||
|
||||
if (y - num <0){
|
||||
m_y=0;
|
||||
}else{
|
||||
m_y = y - num;
|
||||
}
|
||||
|
||||
if (m_x + size > Main.maxTilesX){
|
||||
m_x=Main.maxTilesX - size;
|
||||
}
|
||||
|
||||
if (m_y + size > Main.maxTilesY){
|
||||
m_y=Main.maxTilesY - size;
|
||||
}
|
||||
|
||||
SendData(PacketTypes.TileSendSquare, "", size, m_x, m_y);
|
||||
return true;
|
||||
}
|
||||
catch (IndexOutOfRangeException)
|
||||
{
|
||||
|
||||
// This is expected if square exceeds array.
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue