Merge pull request #1603 from mistzzt/fix-tile-entity

Fix tile entity placing
This commit is contained in:
Chris 2018-02-19 01:52:41 +00:00 committed by GitHub
commit 8d45222af3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 3 deletions

View file

@ -79,6 +79,7 @@ This is the rolling changelog for TShock for Terraria. Use past tense when addin
* Removed `Utils.GetGroup()` also have you seen `Groups.GetGroupByName()`? (@hakusaro) * Removed `Utils.GetGroup()` also have you seen `Groups.GetGroupByName()`? (@hakusaro)
* `Utils.MaxChests()` is now `Utils.HasWorldReachedMaxChests()`. (@hakusaro) * `Utils.MaxChests()` is now `Utils.HasWorldReachedMaxChests()`. (@hakusaro)
* `Utils.GetIPv4Address()` is now `Utils.GetIPv4AddressFromHostname()`. (@hakusaro) * `Utils.GetIPv4Address()` is now `Utils.GetIPv4AddressFromHostname()`. (@hakusaro)
* Fixed the disappearing problem when placing tile entities. (@mistzzt)
## TShock 4.3.25 ## TShock 4.3.25
* Fixed a critical exploit in the Terraria protocol that could cause massive unpreventable world corruption as well as a number of other problems. Thanks to @bartico6 for reporting. Fixed by the efforts of @QuiCM, @hakusaro, and tips in the right directioon from @bartico6. * Fixed a critical exploit in the Terraria protocol that could cause massive unpreventable world corruption as well as a number of other problems. Thanks to @bartico6 for reporting. Fixed by the efforts of @QuiCM, @hakusaro, and tips in the right directioon from @bartico6.

View file

@ -1709,14 +1709,20 @@ namespace TShockAPI
Main.tile[realx, realy].frameY = newtile.FrameY; Main.tile[realx, realy].frameY = newtile.FrameY;
changed = true; changed = true;
} }
// Landmine // Landmine
if (tile.type == TileID.LandMine && !newtile.Active) if (tile.type == TileID.LandMine && !newtile.Active)
{ {
Main.tile[realx, realy].active(false); Main.tile[realx, realy].active(false);
changed = true; changed = true;
} }
// Sensors
if(newtile.Type == TileID.LogicSensor && !Main.tile[realx, realy].active()) // Tile entities: sensors, item frames, training dummies
// here it handles all tile entities listed in `TileEntityID`
if ((newtile.Type == TileID.LogicSensor ||
newtile.Type == TileID.ItemFrame ||
newtile.Type == TileID.TargetDummy) &&
!Main.tile[realx, realy].active())
{ {
Main.tile[realx, realy].type = newtile.Type; Main.tile[realx, realy].type = newtile.Type;
Main.tile[realx, realy].frameX = newtile.FrameX; Main.tile[realx, realy].frameX = newtile.FrameX;
@ -1748,6 +1754,7 @@ namespace TShockAPI
changed = true; changed = true;
} }
} }
// Stone wall <-> Stone wall // Stone wall <-> Stone wall
if (((tile.wall == 1 || tile.wall == 3 || tile.wall == 28 || tile.wall == 83) && if (((tile.wall == 1 || tile.wall == 3 || tile.wall == 28 || tile.wall == 83) &&
(newtile.Wall == 1 || newtile.Wall == 3 || newtile.Wall == 28 || newtile.Wall == 83)) || (newtile.Wall == 1 || newtile.Wall == 3 || newtile.Wall == 28 || newtile.Wall == 83)) ||
@ -1786,8 +1793,8 @@ namespace TShockAPI
{ {
args.Player.SendTileSquare(tileX, tileY, size); args.Player.SendTileSquare(tileX, tileY, size);
} }
args.Handled = true; args.Handled = true;
return;
} }
/// <summary> /// <summary>