Bouncer OnTileEdit - Adding more checks on ReplaceTile action.

This commit is contained in:
Patrikkk 2020-06-09 00:23:23 +02:00
parent 4f66e660d4
commit 0d0641c8c0

View file

@ -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);
@ -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) && !args.Player.HasPermission(Permissions.ignoreplacetiledetection))
{ {
args.Player.TilePlaceThreshold++; args.Player.TilePlaceThreshold++;
var coords = new Vector2(tileX, tileY); var coords = new Vector2(tileX, tileY);