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

@ -3,7 +3,13 @@
This is the rolling changelog for TShock for Terraria. Use past tense when adding new entries; sign your name off when you add or change something. This should primarily be things like user changes, not necessarily codebase changes unless it's really relevant or large. This is the rolling changelog for TShock for Terraria. Use past tense when adding new entries; sign your name off when you add or change something. This should primarily be things like user changes, not necessarily codebase changes unless it's really relevant or large.
## Upcoming Changes ## Upcoming Changes
* API: Added hooks for item, projectile and tile bans (@deadsurgeon42)
* API: New WorldGrassSpread hook which shold allow corruption/crimson/hallow creep config options to work (@DeathCradle)
* Fixed saving when one player is one the server and another one joins (@MarioE)
* Fixed /spawnmob not spawning negative IDs (@MarioE)
* Validated tile placement on PlaceObject; clients can no longer place frames, paintings etc with dirt blocks (@bartico6, @ProfessorXZ)
## TShock 4.3.24
* Updated OpenTerraria API to 1.3.5.3 (@DeathCradle) * Updated OpenTerraria API to 1.3.5.3 (@DeathCradle)
* Updated Terraria Server API to 1.3.5.3 (@WhiteXZ, @hakusaro) * Updated Terraria Server API to 1.3.5.3 (@WhiteXZ, @hakusaro)
* Updated TShock core components to 1.3.5.3 (@hakusaro) * Updated TShock core components to 1.3.5.3 (@hakusaro)

View file

@ -2350,6 +2350,15 @@ namespace TShockAPI
return true; 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); TileObjectData tileData = TileObjectData.GetTileData(type, style, 0);
if (tileData == null) if (tileData == null)
return true; return true;