mirror of
https://github.com/Relintai/godot_voxel.git
synced 2024-11-11 20:35:08 +01:00
Fix VoxelMap::set_voxel() (found by ktksgit)
This commit is contained in:
parent
ec6acc6b24
commit
cdcae06232
@ -51,9 +51,10 @@ VoxelBlock * VoxelBlock::create(VoxelMap & map, Vector3i bpos, VoxelBuffer * buf
|
||||
|
||||
void VoxelMap::set_voxel(int value, Vector3i pos, unsigned int c) {
|
||||
Vector3i bpos = voxel_to_block(pos);
|
||||
VoxelBlock * block = get_block(pos);
|
||||
VoxelBlock * block = get_block(bpos);
|
||||
if (block == NULL) {
|
||||
set_block(bpos, VoxelBlock::create(*this, bpos));
|
||||
block = VoxelBlock::create(*this, bpos);
|
||||
set_block(bpos, block);
|
||||
}
|
||||
block->voxels->set_voxel(value, pos - block_to_voxel(bpos), c);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user