Skip to content

Commit

Permalink
Merge pull request #18 from ATFGK/revert-11-temp
Browse files Browse the repository at this point in the history
Revert "Temp+1"
  • Loading branch information
ATFGK authored Nov 28, 2022
2 parents 8b3fc5e + 1f16ed1 commit 7bdc013
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
22 changes: 11 additions & 11 deletions TShockAPI/Bouncer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -686,18 +686,20 @@ internal void OnTileEdit(object sender, GetDataHandlers.TileEditEventArgs args)
}
}

if (action == EditAction.KillTile && !Main.tileCut[tile.type] && !breakableTiles.Contains(tile.type) && args.Player.RecentFuse == 0)
if (action == EditAction.KillTile && !Main.tileCut[tile.type] && !breakableTiles.Contains(tile.type))
{
// TPlayer.mount.Type 8 => Drill Containment Unit.

// If the tile is an axe tile and they aren't selecting an axe, they're hacking.
if (Main.tileAxe[tile.type] && ((args.Player.TPlayer.mount.Type != MountID.Drill && selectedItem.axe == 0) && !ItemID.Sets.Explosives[selectedItem.netID]))
if (Main.tileAxe[tile.type] && ((args.Player.TPlayer.mount.Type != 8 && selectedItem.axe == 0) && !ItemID.Sets.Explosives[selectedItem.netID] && args.Player.RecentFuse == 0))
{
TShock.Log.ConsoleDebug(GetString("Bouncer / OnTileEdit rejected from (axe) {0} {1} {2}", args.Player.Name, action, editData));
args.Player.SendTileSquareCentered(tileX, tileY, 4);
args.Handled = true;
return;
}
// If the tile is a hammer tile and they aren't selecting a hammer, they're hacking.
else if (Main.tileHammer[tile.type] && ((args.Player.TPlayer.mount.Type != MountID.Drill && selectedItem.hammer == 0) && !ItemID.Sets.Explosives[selectedItem.netID]))
else if (Main.tileHammer[tile.type] && ((args.Player.TPlayer.mount.Type != 8 && selectedItem.hammer == 0) && !ItemID.Sets.Explosives[selectedItem.netID] && args.Player.RecentFuse == 0))
{
TShock.Log.ConsoleDebug(GetString("Bouncer / OnTileEdit rejected from (hammer) {0} {1} {2}", args.Player.Name, action, editData));
args.Player.SendTileSquareCentered(tileX, tileY, 4);
Expand All @@ -709,12 +711,11 @@ internal void OnTileEdit(object sender, GetDataHandlers.TileEditEventArgs args)
// also add an exception for snake coils, they can be removed when the player places a new one or after x amount of time
// If the tile is part of the breakable when placing set, it might be getting broken by a placement.
else if (tile.type != TileID.ItemFrame && tile.type != TileID.MysticSnakeRope
&& !ItemID.Sets.Explosives[selectedItem.netID]
&& !TileID.Sets.BreakableWhenPlacing[tile.type]
&& !Main.tileAxe[tile.type] && !Main.tileHammer[tile.type] && tile.wall == 0
&& selectedItem.pick == 0 && selectedItem.type != ItemID.GravediggerShovel
&& args.Player.TPlayer.mount.Type != MountID.Drill
&& args.Player.TPlayer.mount.Type != MountID.DiggingMoleMinecart)
&& !Main.tileAxe[tile.type] && !Main.tileHammer[tile.type] && tile.wall == 0 &&
args.Player.TPlayer.mount.Type != MountID.Drill && selectedItem.pick == 0 &&
selectedItem.type != ItemID.GravediggerShovel &&
!ItemID.Sets.Explosives[selectedItem.netID] && args.Player.RecentFuse == 0
&& !TileID.Sets.BreakableWhenPlacing[tile.type])
{
TShock.Log.ConsoleDebug(GetString("Bouncer / OnTileEdit rejected from (pick) {0} {1} {2}", args.Player.Name, action,
editData));
Expand Down Expand Up @@ -775,7 +776,7 @@ internal void OnTileEdit(object sender, GetDataHandlers.TileEditEventArgs args)
if ((action == EditAction.PlaceTile || action == EditAction.ReplaceTile) && editData != selectedItem.createTile)
{
/// These would get caught up in the below check because Terraria does not set their createTile field.
if (selectedItem.netID != ItemID.IceRod && selectedItem.netID != ItemID.DirtBomb && selectedItem.netID != ItemID.StickyBomb && (args.Player.TPlayer.mount.Type != MountID.DiggingMoleMinecart || editData != TileID.MinecartTrack))
if (selectedItem.netID != ItemID.IceRod && selectedItem.netID != ItemID.DirtBomb && selectedItem.netID != ItemID.StickyBomb)
{
TShock.Log.ConsoleDebug(GetString("Bouncer / OnTileEdit rejected from tile placement not matching selected item createTile {0} {1} {2} selectedItemID:{3} createTile:{4}", args.Player.Name, action, editData, selectedItem.netID, selectedItem.createTile));
args.Player.SendTileSquareCentered(tileX, tileY, 4);
Expand Down Expand Up @@ -1344,7 +1345,6 @@ internal void OnNewProjectile(object sender, GetDataHandlers.NewProjectileEventA
|| type == ProjectileID.Dynamite
|| type == ProjectileID.StickyBomb
|| type == ProjectileID.StickyDynamite
|| type == ProjectileID.BombFish
|| type == ProjectileID.ScarabBomb
|| type == ProjectileID.DirtBomb))
{
Expand Down
2 changes: 0 additions & 2 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,7 @@ Use past tense when adding new entries; sign your name off when you add or chang
* If there is no section called "Upcoming changes" below this line, please add one with `## Upcoming changes` as the first line, and then a bulleted item directly after with the first change. -->


## Upcoming changes

* Allowed Digging Molecart and bomb fish to break tiles and place tracks (@sgkoishi)
* Added `ShadowCandle` and `BrainOfConfusionBuff` (BoC dodge buff) to the `PlayerAddBuffWhitelist` (@drunderscore)
* Improved rejection message and code duplication in `OnPlayerBuff` (@drunderscore)
* This will make it so Bouncer rejections regarding `PlayerAddBuff` will now always include the sender index, buff type, receiver index, and time in ticks, allowing much faster triage of buff whitelist issues.
Expand Down

0 comments on commit 7bdc013

Please sign in to comment.