Merge pull request #2024 from Pryaxis/fixtilebanbypass
Bouncer OnTileEdit - Add tile/wall replace action to TileEdit bouncer checks.
This commit is contained in:
commit
e0b9c8b4f3
2 changed files with 11 additions and 6 deletions
|
|
@ -4,6 +4,11 @@ This is the rolling changelog for TShock for Terraria. Use past tense when addin
|
||||||
|
|
||||||
## Upcoming changes
|
## Upcoming changes
|
||||||
* Installed new sprinklers!
|
* Installed new sprinklers!
|
||||||
|
* Fix multiple holes in Bouncer OnTileData. (@Patrikkk, @hakusaro)
|
||||||
|
* Issue where players could replace tiles with banned tiles without permission.
|
||||||
|
* Including replace action in TilePlace threshold incrementation, so players cannot bypass the threshold while replacing tiles/walls.
|
||||||
|
* Including check for maxTileSets when player is replacing tiles, so players cannot send invalid tile data through the replace tile action.
|
||||||
|
* Including a check for ReplaceWall when the tile is a Breakable/CutTile.
|
||||||
|
|
||||||
## TShock 4.4.0 (Pre-release 11)
|
## TShock 4.4.0 (Pre-release 11)
|
||||||
* New permission `tshock.tp.pylon` to enable teleporting via Teleportation Pylons (@QuiCM)
|
* New permission `tshock.tp.pylon` to enable teleporting via Teleportation Pylons (@QuiCM)
|
||||||
|
|
|
||||||
|
|
@ -259,7 +259,7 @@ namespace TShockAPI
|
||||||
int lastKilledProj = args.Player.LastKilledProjectile;
|
int lastKilledProj = args.Player.LastKilledProjectile;
|
||||||
ITile tile = Main.tile[tileX, tileY];
|
ITile tile = Main.tile[tileX, tileY];
|
||||||
|
|
||||||
if (action == EditAction.PlaceTile)
|
if (action == EditAction.PlaceTile || action == EditAction.ReplaceTile)
|
||||||
{
|
{
|
||||||
if (TShock.TileBans.TileIsBanned(editData, args.Player))
|
if (TShock.TileBans.TileIsBanned(editData, args.Player))
|
||||||
{
|
{
|
||||||
|
|
@ -330,7 +330,7 @@ namespace TShockAPI
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (action == EditAction.PlaceTile || action == EditAction.PlaceWall)
|
else if (action == EditAction.PlaceTile || action == EditAction.ReplaceTile || action == EditAction.PlaceWall || action == EditAction.ReplaceWall)
|
||||||
{
|
{
|
||||||
if ((action == EditAction.PlaceTile && TShock.Config.PreventInvalidPlaceStyle) &&
|
if ((action == EditAction.PlaceTile && TShock.Config.PreventInvalidPlaceStyle) &&
|
||||||
(MaxPlaceStyles.ContainsKey(editData) && style > MaxPlaceStyles[editData]) &&
|
(MaxPlaceStyles.ContainsKey(editData) && style > MaxPlaceStyles[editData]) &&
|
||||||
|
|
@ -358,7 +358,7 @@ namespace TShockAPI
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (editData >= (action == EditAction.PlaceTile ? Main.maxTileSets : Main.maxWallTypes))
|
if (editData >= ((action == EditAction.PlaceTile || action == EditAction.ReplaceTile) ? Main.maxTileSets : Main.maxWallTypes))
|
||||||
{
|
{
|
||||||
TShock.Log.ConsoleDebug("Bouncer / OnTileEdit rejected from (ms3) {0} {1} {2}", args.Player.Name, action, editData);
|
TShock.Log.ConsoleDebug("Bouncer / OnTileEdit rejected from (ms3) {0} {1} {2}", args.Player.Name, action, editData);
|
||||||
args.Player.SendTileSquare(tileX, tileY, 4);
|
args.Player.SendTileSquare(tileX, tileY, 4);
|
||||||
|
|
@ -437,7 +437,7 @@ namespace TShockAPI
|
||||||
}
|
}
|
||||||
if (TShock.Config.AllowCutTilesAndBreakables && Main.tileCut[tile.type])
|
if (TShock.Config.AllowCutTilesAndBreakables && Main.tileCut[tile.type])
|
||||||
{
|
{
|
||||||
if (action == EditAction.KillWall)
|
if (action == EditAction.KillWall || action == EditAction.ReplaceWall)
|
||||||
{
|
{
|
||||||
TShock.Log.ConsoleDebug("Bouncer / OnTileEdit rejected from sts allow cut from {0} {1} {2}", args.Player.Name, action, editData);
|
TShock.Log.ConsoleDebug("Bouncer / OnTileEdit rejected from sts allow cut from {0} {1} {2}", args.Player.Name, action, editData);
|
||||||
args.Player.SendTileSquare(tileX, tileY, 1);
|
args.Player.SendTileSquare(tileX, tileY, 1);
|
||||||
|
|
@ -536,7 +536,7 @@ namespace TShockAPI
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((action == EditAction.PlaceTile || action == EditAction.PlaceWall) && !args.Player.HasPermission(Permissions.ignoreplacetiledetection))
|
if ((action == EditAction.PlaceTile || action == EditAction.ReplaceTile || action == EditAction.PlaceWall || action == EditAction.ReplaceWall) && !args.Player.HasPermission(Permissions.ignoreplacetiledetection))
|
||||||
{
|
{
|
||||||
args.Player.TilePlaceThreshold++;
|
args.Player.TilePlaceThreshold++;
|
||||||
var coords = new Vector2(tileX, tileY);
|
var coords = new Vector2(tileX, tileY);
|
||||||
|
|
@ -545,7 +545,7 @@ namespace TShockAPI
|
||||||
args.Player.TilesCreated.Add(coords, Main.tile[tileX, tileY]);
|
args.Player.TilesCreated.Add(coords, Main.tile[tileX, tileY]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((action == EditAction.KillTile || action == EditAction.KillTileNoItem || action == EditAction.KillWall) && Main.tileSolid[Main.tile[tileX, tileY].type] &&
|
if ((action == EditAction.KillTile || action == EditAction.KillTileNoItem || action == EditAction.ReplaceTile || action == EditAction.KillWall || action == EditAction.ReplaceWall) && Main.tileSolid[Main.tile[tileX, tileY].type] &&
|
||||||
!args.Player.HasPermission(Permissions.ignorekilltiledetection))
|
!args.Player.HasPermission(Permissions.ignorekilltiledetection))
|
||||||
{
|
{
|
||||||
args.Player.TileKillThreshold++;
|
args.Player.TileKillThreshold++;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue