diff --git a/patches/tModLoader/Terraria/GameContent/Liquid/LiquidEdgeRenderer.cs b/patches/tModLoader/Terraria/GameContent/Liquid/LiquidEdgeRenderer.cs index 665fc9af2b..0ac96eee58 100644 --- a/patches/tModLoader/Terraria/GameContent/Liquid/LiquidEdgeRenderer.cs +++ b/patches/tModLoader/Terraria/GameContent/Liquid/LiquidEdgeRenderer.cs @@ -286,13 +286,24 @@ public static unsafe void CollectEdgeData(LiquidRenderer.LiquidCache* pCache, Ti } if (slope is SlopeType.SlopeDownRight or SlopeType.SlopeUpRight) { offset = new Vector2(0, depthPush); - size = (14, 16 - depthPush); + if (WorldGen.SolidOrSlopedTile(tileRightCache)) { + size = (16, 16 - depthPush); + } + else { + size = (14, 16 - depthPush); + } } } else if (right) { if (slope is SlopeType.SlopeDownLeft or SlopeType.SlopeUpLeft) { - offset = new Vector2(2, depthPush); - size = (14, 16 - depthPush); + if (WorldGen.SolidOrSlopedTile(tileLeftCache)) { + offset = new Vector2(0, depthPush); + size = (16, 16 - depthPush); + } + else { + offset = new Vector2(2, depthPush); + size = (14, 16 - depthPush); + } } if (slope is SlopeType.SlopeDownRight or SlopeType.SlopeUpRight) { offset = new Vector2(14, depthPush); diff --git a/patches/tModLoader/Terraria/Main.cs.patch b/patches/tModLoader/Terraria/Main.cs.patch index 617e3ea26b..01d3783969 100644 --- a/patches/tModLoader/Terraria/Main.cs.patch +++ b/patches/tModLoader/Terraria/Main.cs.patch @@ -6531,6 +6531,21 @@ TilesRenderer.DrawLiquidBehindTiles(waterStyle); LiquidRenderer.Instance.DrawNormalLiquids(spriteBatch, drawOffset, waterStyle, Alpha, bg); +@@ -47337,6 +_,14 @@ + + public static void DrawTileInWater(Vector2 drawOffset, int x, int y) + { ++ // TML(liquid-slopes): There seems to be an IOOB being thrown here, ++ // presumably due to tile coordinates being stored as relative XY ++ // positions as a result of the merger with the shimmer draw cache. ++ // For now, just add a safety check here. We can keep this even if ++ // it's properly addressed. ++ if (!WorldGen.InWorld(x, y)) ++ return; ++ + if (Main.tile[x, y] != null && Main.tile[x, y].active() && Main.tile[x, y].type == 518) { + instance.LoadTiles(Main.tile[x, y].type); + Tile tile = Main.tile[x, y]; @@ -47776,6 +_,7 @@ } } diff --git a/patches/tModLoader/Terraria/Terraria.csproj.patch b/patches/tModLoader/Terraria/Terraria.csproj.patch index 92ced8ada9..7e9a4e6df3 100644 --- a/patches/tModLoader/Terraria/Terraria.csproj.patch +++ b/patches/tModLoader/Terraria/Terraria.csproj.patch @@ -78,7 +78,7 @@ + + -+ ++ + + + diff --git a/patches/tModLoader/Terraria/release_extras/tMLMod.targets b/patches/tModLoader/Terraria/release_extras/tMLMod.targets index 33bf641f8a..e3e150c1f5 100644 --- a/patches/tModLoader/Terraria/release_extras/tMLMod.targets +++ b/patches/tModLoader/Terraria/release_extras/tMLMod.targets @@ -41,8 +41,8 @@ - - + +