summaryrefslogtreecommitdiffstats
path: root/game/shared/world/feature.cc
diff options
context:
space:
mode:
authoruntodesu <kirill@untode.su>2025-09-11 18:18:08 +0500
committeruntodesu <kirill@untode.su>2025-09-11 18:18:08 +0500
commit68694a9c9d7d27d3b79c7b96bb67f56db2f75c45 (patch)
treefa306d55b8333ffdb184befd41386830af2c3945 /game/shared/world/feature.cc
parent12947aafcc6a6eb362cc454e2149796ec9265743 (diff)
downloadvoxelius-68694a9c9d7d27d3b79c7b96bb67f56db2f75c45.tar.bz2
voxelius-68694a9c9d7d27d3b79c7b96bb67f56db2f75c45.zip
Metadata voxels!
Diffstat (limited to 'game/shared/world/feature.cc')
-rw-r--r--game/shared/world/feature.cc7
1 files changed, 3 insertions, 4 deletions
diff --git a/game/shared/world/feature.cc b/game/shared/world/feature.cc
index 4212043..cbf660e 100644
--- a/game/shared/world/feature.cc
+++ b/game/shared/world/feature.cc
@@ -4,7 +4,6 @@
#include "shared/world/chunk.hh"
#include "shared/world/dimension.hh"
-#include "shared/world/voxel_storage.hh"
#include "shared/coord.hh"
@@ -30,7 +29,7 @@ void world::Feature::place(const voxel_pos& vpos, Dimension* dimension) const
}
}
-void world::Feature::place(const voxel_pos& vpos, const chunk_pos& cpos, VoxelStorage& voxels) const
+void world::Feature::place(const voxel_pos& vpos, const chunk_pos& cpos, Chunk& chunk) const
{
for(const auto [rpos, voxel, overwrite] : (*this)) {
auto it_vpos = vpos + rpos;
@@ -40,14 +39,14 @@ void world::Feature::place(const voxel_pos& vpos, const chunk_pos& cpos, VoxelSt
auto it_lpos = coord::to_local(it_vpos);
auto it_index = coord::to_index(it_lpos);
- if(voxels[it_index] && !overwrite) {
+ if(chunk.get_voxel(it_index) && !overwrite) {
// There is something in the way
// and the called intentionally requested
// we do not force feature to overwrite voxels
continue;
}
- voxels[it_index] = voxel;
+ chunk.set_voxel(voxel, it_index);
}
}
}