Validate tile placement on PlaceObject, update CHANGELOG.md. Fixes #1418
This commit is contained in:
parent
d891849945
commit
6b3f18b1da
2 changed files with 15 additions and 0 deletions
|
|
@ -2350,6 +2350,15 @@ namespace TShockAPI
|
|||
return true;
|
||||
}
|
||||
|
||||
// This is neccessary to check in order to prevent special tiles such as
|
||||
// queen bee larva, paintings etc that use this packet from being placed
|
||||
// without selecting the right item.
|
||||
if (type != args.TPlayer.inventory[args.TPlayer.selectedItem].createTile)
|
||||
{
|
||||
args.Player.SendTileSquare(x, y, 4);
|
||||
return true;
|
||||
}
|
||||
|
||||
TileObjectData tileData = TileObjectData.GetTileData(type, style, 0);
|
||||
if (tileData == null)
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue