From fc7f20566e1ed4979a0f4fa3d8d592edc44bd145 Mon Sep 17 00:00:00 2001 From: Deathmax Date: Sun, 4 Dec 2011 16:09:31 +0800 Subject: [PATCH] HandleSendTileSquare now takes into account Tile's attempt at conversing bandwidth. --- TShockAPI/GetDataHandlers.cs | 7 +++++++ TShockAPI/Net/NetTile.cs | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/TShockAPI/GetDataHandlers.cs b/TShockAPI/GetDataHandlers.cs index 91d42967..7a1ebd6a 100644 --- a/TShockAPI/GetDataHandlers.cs +++ b/TShockAPI/GetDataHandlers.cs @@ -221,6 +221,13 @@ namespace TShockAPI for (int y = 0; y < size; y++) { tiles[x, y] = new NetTile(args.Data); + if (tiles[x, y].SameTiles > 0) + { + var num = tiles[x, y].SameTiles; + var tile = tiles[x, y]; + for (y++; y < y + num + 1; y++) + tiles[x, y] = tile; + } } } diff --git a/TShockAPI/Net/NetTile.cs b/TShockAPI/Net/NetTile.cs index 181d93a6..a9d138ac 100644 --- a/TShockAPI/Net/NetTile.cs +++ b/TShockAPI/Net/NetTile.cs @@ -38,6 +38,8 @@ namespace TShockAPI.Net public bool HasLiquid { get { return Liquid > 0; } } public bool FrameImportant { get { return Main.tileFrameImportant[Type]; } } + public int SameTiles { get; set; } + public NetTile() { Active = false; @@ -125,7 +127,7 @@ namespace TShockAPI.Net if (flags.HasFlag(TileFlags.Wire)) Wire = true; - var samenum = stream.ReadInt16(); + SameTiles = stream.ReadInt16(); } }