Set the grid scale as well when changing the scale
This commit is contained in:
parent
4807c12387
commit
dd2680abd5
2 changed files with 2 additions and 1 deletions
|
@ -195,6 +195,7 @@ namespace TechbloxModdingAPI
|
||||||
if (value.y < 4e-5) value.y = uscale;
|
if (value.y < 4e-5) value.y = uscale;
|
||||||
if (value.z < 4e-5) value.z = uscale;
|
if (value.z < 4e-5) value.z = uscale;
|
||||||
BlockEngine.GetBlockInfo<ScalingEntityStruct>(this).scale = value;
|
BlockEngine.GetBlockInfo<ScalingEntityStruct>(this).scale = value;
|
||||||
|
BlockEngine.GetBlockInfo<GridScaleStruct>(this).gridScale = value - (int3) value + 1;
|
||||||
if (!Exists) return; //UpdateCollision needs the block to exist
|
if (!Exists) return; //UpdateCollision needs the block to exist
|
||||||
ScalingEngine.UpdateCollision(Id);
|
ScalingEngine.UpdateCollision(Id);
|
||||||
BlockEngine.UpdateDisplayedBlock(Id);
|
BlockEngine.UpdateDisplayedBlock(Id);
|
||||||
|
|
|
@ -72,7 +72,7 @@ namespace TechbloxModdingAPI.Blocks
|
||||||
});
|
});
|
||||||
structInitializer.Init(new UniformBlockScaleEntityStruct {scaleFactor = 1});
|
structInitializer.Init(new UniformBlockScaleEntityStruct {scaleFactor = 1});
|
||||||
structInitializer.Get<CubeMaterialStruct>().materialId = (byte) BlockMaterial.SteelBodywork;
|
structInitializer.Get<CubeMaterialStruct>().materialId = (byte) BlockMaterial.SteelBodywork;
|
||||||
structInitializer.Init(new BlockPlacementInfoStruct() //TODO: Grid scale
|
structInitializer.Init(new BlockPlacementInfoStruct
|
||||||
{
|
{
|
||||||
loadedFromDisk = false,
|
loadedFromDisk = false,
|
||||||
placedBy = playerId,
|
placedBy = playerId,
|
||||||
|
|
Loading…
Reference in a new issue