diff --git a/CHANGELOG.md b/CHANGELOG.md index 36524ad6..b36b4a62 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,9 +3,11 @@ This is the rolling changelog for TShock for Terraria. Use past tense when adding new entries; sign your name off when you add or change something. This should primarily be things like user changes, not necessarily codebase changes unless it's really relevant or large. ## Upcoming release -* Fixed a longstanding issue with SendTileSquare that could result in desyncs and visual errors (@QuiCM) -* Fixed placement issues with Item Frames, Teleportation Pylons, etc (@QuiCM) +* Fix all rope coils. (@Olink) +* Fixed a longstanding issue with SendTileSquare that could result in desyncs and visual errors. (@QuiCM) +* Fixed placement issues with Item Frames, Teleportation Pylons, etc. (@QuiCM) * Doors are good now for real probably (@QuiCM, @Hakusaro, @Olink) +* Bump default max damage received cap to 42,000 to accommodate the Empress of Light's instant kill death amount. (@hakusaro, @moisterrific, @Irethia, @Ayrawei) ## TShock 4.4.0 (Pre-release 9) * Fixed pet licenses. (@Olink) @@ -34,9 +36,6 @@ This is the rolling changelog for TShock for Terraria. Use past tense when addin * To add this command to your guest group, give them `tshock.synclocalarea`, with `/group addperm guest tshock.synclocalarea`. * This command may be removed at any time in the future (and will likely be removed when send tile square handling is fixed). * Fixed smart door automatic door desync and deletion issue. (@hakusaro) -* Bump default max damage received cap to 42,000 to accommodate the Empress of Light's instant kill death amount. (@hakusaro, @moisterrific, @Irethia, @Ayrawei) - - ## TShock 4.4.0 (Pre-release 8) * Update for OTAPI 2.0.0.36 and Terraria 1.4.0.4. (@hakusaro, @Patrikkk, @DeathCradle) diff --git a/TShockAPI/Bouncer.cs b/TShockAPI/Bouncer.cs index ed2b2e71..098dd468 100644 --- a/TShockAPI/Bouncer.cs +++ b/TShockAPI/Bouncer.cs @@ -300,6 +300,19 @@ namespace TShockAPI { args.Player.LastKilledProjectile = 0; } + else if (CoilTileIds.Contains(editData)) + { + //projectile should be the same X coordinate as all tile places + if (!args.Player.RecentlyCreatedProjectiles.Any(p => GetDataHandlers.projectileCreatesTile.ContainsKey(Main.projectile[p.Index].type) && + Math.Abs((int)(Main.projectile[p.Index].position.X / 16f) - tileX) <= Math.Abs(Main.projectile[p.Index].velocity.X) && + GetDataHandlers.projectileCreatesTile[Main.projectile[p.Index].type] == editData)) + { + TShock.Log.ConsoleDebug("Bouncer / OnTileEdit rejected from (inconceivable rope coil) {0} {1} {2}", args.Player.Name, action, editData); + args.Player.SendTileSquare(tileX, tileY, 1); + args.Handled = true; + return; + } + } else if (action == EditAction.PlaceTile || action == EditAction.PlaceWall) { if ((action == EditAction.PlaceTile && TShock.Config.PreventInvalidPlaceStyle) && diff --git a/TShockAPI/GetDataHandlers.cs b/TShockAPI/GetDataHandlers.cs index 2ffd3089..9e249d30 100644 --- a/TShockAPI/GetDataHandlers.cs +++ b/TShockAPI/GetDataHandlers.cs @@ -3727,7 +3727,20 @@ namespace TShockAPI { ProjectileID.EbonsandBallGun, TileID.Ebonsand }, { ProjectileID.PearlSandBallGun, TileID.Pearlsand }, { ProjectileID.CrimsandBallGun, TileID.Crimsand }, - { ProjectileID.MysticSnakeCoil, TileID.MysticSnakeRope } + { ProjectileID.MysticSnakeCoil, TileID.MysticSnakeRope }, + { ProjectileID.RopeCoil, TileID.Rope }, + { ProjectileID.SilkRopeCoil, TileID.SilkRope }, + { ProjectileID.VineRopeCoil, TileID.VineRope }, + { ProjectileID.WebRopeCoil, TileID.WebRope } + }; + + internal static List CoilTileIds = new List() + { + TileID.MysticSnakeRope, + TileID.Rope, + TileID.SilkRope, + TileID.VineRope, + TileID.WebRope }; internal static Dictionary projectileCreatesLiquid = new Dictionary diff --git a/TShockAPI/PlayerData.cs b/TShockAPI/PlayerData.cs index 562dea80..d6540e34 100644 --- a/TShockAPI/PlayerData.cs +++ b/TShockAPI/PlayerData.cs @@ -496,7 +496,7 @@ namespace TShockAPI } var response = NetCreativeUnlocksModule.SerializeItemSacrifice(i, amount); - NetManager.Instance.SendToClient(response, player.TPlayer.whoAmI); + NetManager.Instance.SendToClient(response, player.Index); } } } diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs index a0bc4e64..6d84817c 100644 --- a/TShockAPI/TShock.cs +++ b/TShockAPI/TShock.cs @@ -1639,7 +1639,8 @@ namespace TShockAPI if (e.number >= 0 && e.number < Main.projectile.Length) { var projectile = Main.projectile[e.number]; - if (projectile.active && projectile.owner >= 0 && GetDataHandlers.projectileCreatesLiquid.ContainsKey(projectile.type)) + if (projectile.active && projectile.owner >= 0 && + (GetDataHandlers.projectileCreatesLiquid.ContainsKey(projectile.type) || GetDataHandlers.projectileCreatesTile.ContainsKey(projectile.type))) { var player = Players[projectile.owner]; if (player != null)