Implemented inline void set_id_if_air
This commit is contained in:
@@ -104,6 +104,17 @@ struct world
|
||||
voxel_set_id(voxels[x + x_res * (y + y_res * z)], id);
|
||||
}
|
||||
|
||||
// Set the block_id information of the voxel at the specified coordinates,
|
||||
// if the current block_id of the voxel at the specified coordinates is
|
||||
// id_air.
|
||||
|
||||
inline void set_id_if_air(unsigned int x, unsigned int y, unsigned int z, block_id id)
|
||||
{
|
||||
if (get_id(x, y, z) == id_air)
|
||||
{
|
||||
voxel_set_id(voxels[x + x_res * (y + y_res * z)], id);
|
||||
}
|
||||
}
|
||||
// Set the block_id information of the voxel at the specified coordinates,
|
||||
// if the coordinates are within the bounds of the world.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user