Browse Source

Set the grid scale as well when changing the scale

tags/v2.0.0
NorbiPeti 3 years ago
parent
commit
dd2680abd5
Signed by: NorbiPeti <szatmari.norbert.peter@gmail.com> GPG Key ID: DBA4C4549A927E56
2 changed files with 2 additions and 1 deletions
  1. +1
    -0
      TechbloxModdingAPI/Block.cs
  2. +1
    -1
      TechbloxModdingAPI/Blocks/PlacementEngine.cs

+ 1
- 0
TechbloxModdingAPI/Block.cs View File

@@ -195,6 +195,7 @@ namespace TechbloxModdingAPI
if (value.y < 4e-5) value.y = uscale;
if (value.z < 4e-5) value.z = uscale;
BlockEngine.GetBlockInfo<ScalingEntityStruct>(this).scale = value;
BlockEngine.GetBlockInfo<GridScaleStruct>(this).gridScale = value - (int3) value + 1;
if (!Exists) return; //UpdateCollision needs the block to exist
ScalingEngine.UpdateCollision(Id);
BlockEngine.UpdateDisplayedBlock(Id);


+ 1
- 1
TechbloxModdingAPI/Blocks/PlacementEngine.cs View File

@@ -72,7 +72,7 @@ namespace TechbloxModdingAPI.Blocks
});
structInitializer.Init(new UniformBlockScaleEntityStruct {scaleFactor = 1});
structInitializer.Get<CubeMaterialStruct>().materialId = (byte) BlockMaterial.SteelBodywork;
structInitializer.Init(new BlockPlacementInfoStruct() //TODO: Grid scale
structInitializer.Init(new BlockPlacementInfoStruct
{
loadedFromDisk = false,
placedBy = playerId,


Loading…
Cancel
Save