Validate tile placement on PlaceObject, update CHANGELOG.md. Fixes #1418

This commit is contained in:
ProfessorXZ 2017-07-05 15:09:31 +02:00
parent d891849945
commit 6b3f18b1da
2 changed files with 15 additions and 0 deletions

View file

@ -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;