From dd2680abd5980495b279ab5f0f924f3422e06526 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Thu, 13 May 2021 01:41:20 +0200 Subject: [PATCH] Set the grid scale as well when changing the scale --- TechbloxModdingAPI/Block.cs | 1 + TechbloxModdingAPI/Blocks/PlacementEngine.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/TechbloxModdingAPI/Block.cs b/TechbloxModdingAPI/Block.cs index e8626fc..8947b41 100644 --- a/TechbloxModdingAPI/Block.cs +++ b/TechbloxModdingAPI/Block.cs @@ -195,6 +195,7 @@ namespace TechbloxModdingAPI if (value.y < 4e-5) value.y = uscale; if (value.z < 4e-5) value.z = uscale; BlockEngine.GetBlockInfo(this).scale = value; + BlockEngine.GetBlockInfo(this).gridScale = value - (int3) value + 1; if (!Exists) return; //UpdateCollision needs the block to exist ScalingEngine.UpdateCollision(Id); BlockEngine.UpdateDisplayedBlock(Id); diff --git a/TechbloxModdingAPI/Blocks/PlacementEngine.cs b/TechbloxModdingAPI/Blocks/PlacementEngine.cs index b7b46d1..b62d2d8 100644 --- a/TechbloxModdingAPI/Blocks/PlacementEngine.cs +++ b/TechbloxModdingAPI/Blocks/PlacementEngine.cs @@ -72,7 +72,7 @@ namespace TechbloxModdingAPI.Blocks }); structInitializer.Init(new UniformBlockScaleEntityStruct {scaleFactor = 1}); structInitializer.Get().materialId = (byte) BlockMaterial.SteelBodywork; - structInitializer.Init(new BlockPlacementInfoStruct() //TODO: Grid scale + structInitializer.Init(new BlockPlacementInfoStruct { loadedFromDisk = false, placedBy = playerId,