From 01fcc73116da7045509a6eb2ed685f9a4a73c837 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Sat, 18 Apr 2020 18:28:40 -0400 Subject: [PATCH 1/2] Bathtubs can now be placed on platforms. --- Utilities/CalamityUtils.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Utilities/CalamityUtils.cs b/Utilities/CalamityUtils.cs index b9c73a2d65..2c7f817d7a 100644 --- a/Utilities/CalamityUtils.cs +++ b/Utilities/CalamityUtils.cs @@ -1571,7 +1571,7 @@ namespace CalamityMod TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.Origin = new Point16(1, 1); TileObjectData.newTile.UsesCustomCanPlace = true; - TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile, 4, 0); + TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop, 4, 0); TileObjectData.newTile.LavaDeath = !lavaImmune; TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); TileObjectData.newAlternate.Direction = TileObjectDirection.PlaceRight; From 59ff98dd24fd40fa7759b762e16cc214ff902ac1 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Sat, 18 Apr 2020 18:30:35 -0400 Subject: [PATCH 2/2] Eutrophic Shelf no longer corrupts vanilla data. This kills the Calamity + AA bug. --- .../CraftingStations/EutrophicCrafting.cs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Tiles/Furniture/CraftingStations/EutrophicCrafting.cs b/Tiles/Furniture/CraftingStations/EutrophicCrafting.cs index f439cc2fe6..907995c7df 100644 --- a/Tiles/Furniture/CraftingStations/EutrophicCrafting.cs +++ b/Tiles/Furniture/CraftingStations/EutrophicCrafting.cs @@ -15,15 +15,23 @@ namespace CalamityMod.Tiles.Furniture.CraftingStations Main.tileLighted[Type] = true; Main.tileFrameImportant[Type] = true; Main.tileLavaDeath[Type] = true; + TileObjectData.newTile.CopyFrom(TileObjectData.Style3x3); - TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.None, 0, 0); TileObjectData.newTile.StyleHorizontal = true; + // Remove the bottom anchor entirely, this thing hangs from the wall. + TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.None, 0, 0); + TileObjectData.newTile.AnchorRight = new AnchorData(AnchorType.SolidTile, 2, 1); + + // When this Direction property set executes, newTile._tileObjectBase gets separated from Style3x3._tileObjectBase. + // As such, no data corruption occurs. + TileObjectData.newTile.Direction = TileObjectDirection.PlaceLeft; TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); + // Add a wall anchor on the opposite side for the alternate style. TileObjectData.newAlternate.AnchorLeft = new AnchorData(AnchorType.SolidTile, 2, 1); + + // This line used to corrupt TileObjectData.Style3x3.Direction to PlaceRight. This has noe been fixed. TileObjectData.newAlternate.Direction = TileObjectDirection.PlaceRight; TileObjectData.addAlternate(1); - TileObjectData.newTile.AnchorRight = new AnchorData(AnchorType.SolidTile, 2, 1); - TileObjectData.newTile.Direction = TileObjectDirection.PlaceLeft; TileObjectData.addTile(Type); ModTranslation name = CreateMapEntryName(); name.SetDefault("Eutrophic Shelf");