Set the grid scale as well when changing the scale

This commit is contained in:
Norbi Peti 2021-05-13 01:41:20 +02:00
parent 4807c12387
commit dd2680abd5
No known key found for this signature in database
GPG key ID: DBA4C4549A927E56
2 changed files with 2 additions and 1 deletions

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);

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,