Skip to content

Commit

Permalink
Handle TileFrame boundary
Browse files Browse the repository at this point in the history
  • Loading branch information
sgkoishi committed Oct 21, 2024
1 parent ad28296 commit 45c6ebc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Core/Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ private void PostTShockInitialize()
{
if (!Terraria.Program.LaunchParameters.TryAdd("-ip", System.Net.IPAddress.IPv6Any.ToString()))
{
TShockAPI.TShock.Log.Warn("Listening on existing address, IPv6 dual-stack disabled.");
TShockAPI.TShock.Log.Warn("Listening on existing address, attempts to enable IPv6 dual-stack without -ip.");
}
}
}
Expand Down
7 changes: 5 additions & 2 deletions Core/WorldGen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,15 @@ private void MMHook_WorldGen_KillTile(On.Terraria.WorldGen.orig_KillTile orig, i

private void MMHook_WorldGen_TileFrame(On.Terraria.WorldGen.orig_TileFrame orig, int i, int j, bool resetFrame, bool noBreak)
{
var pos = (((ulong) i) << 32) | ((uint) j);
if (i <= 5 || j <= 5 || i >= Terraria.Main.maxTilesX - 5 || j >= Terraria.Main.maxTilesY - 5)
{
return;
}
var type = Terraria.Main.tile[i, j].type;
orig.Invoke(i, j, resetFrame, noBreak);
if (type != Terraria.Main.tile[i, j].type && this.config.Mitigation.Value.RecursiveTileBreak.Value && !this._pendingTileFrame.Contains(pos))

Check failure on line 166 in Core/WorldGen.cs

View workflow job for this annotation

GitHub Actions / build

The name 'pos' does not exist in the current context

Check failure on line 166 in Core/WorldGen.cs

View workflow job for this annotation

GitHub Actions / build

The name 'pos' does not exist in the current context
{
this._pendingTileFrame.Add(pos);
this._pendingTileFrame.Add((((ulong) i) << 32) | ((uint) j));
}
}
}

0 comments on commit 45c6ebc

Please sign in to comment.