diff options
| author | untodesu <kirill@untode.su> | 2025-09-12 13:33:52 +0500 |
|---|---|---|
| committer | untodesu <kirill@untode.su> | 2025-09-12 13:33:52 +0500 |
| commit | e9076f22fe2a49d1cd8933e54b7b00c5dd943269 (patch) | |
| tree | 89b8a4ca1861196e067dcba218fad1d7f889b860 /game/shared/world/item_registry.cc | |
| parent | 68694a9c9d7d27d3b79c7b96bb67f56db2f75c45 (diff) | |
| download | voxelius-e9076f22fe2a49d1cd8933e54b7b00c5dd943269.tar.bz2 voxelius-e9076f22fe2a49d1cd8933e54b7b00c5dd943269.zip | |
It compiles
Diffstat (limited to 'game/shared/world/item_registry.cc')
| -rw-r--r-- | game/shared/world/item_registry.cc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/game/shared/world/item_registry.cc b/game/shared/world/item_registry.cc index d1b9ff4..783c85e 100644 --- a/game/shared/world/item_registry.cc +++ b/game/shared/world/item_registry.cc @@ -14,7 +14,7 @@ world::ItemInfoBuilder::ItemInfoBuilder(std::string_view name) {
prototype.name = name;
prototype.texture = std::string();
- prototype.place_voxel = NULL_VOXEL_ID;
+ prototype.place_voxel = nullptr;
prototype.cached_texture = nullptr;
}
@@ -25,7 +25,7 @@ world::ItemInfoBuilder& world::ItemInfoBuilder::set_texture(std::string_view tex return *this;
}
-world::ItemInfoBuilder& world::ItemInfoBuilder::set_place_voxel(voxel_id place_voxel)
+world::ItemInfoBuilder& world::ItemInfoBuilder::set_place_voxel(const Voxel* place_voxel)
{
prototype.place_voxel = place_voxel;
return *this;
@@ -99,7 +99,10 @@ std::uint64_t world::item_registry::calculate_checksum(void) for(const auto& info : world::item_registry::items) {
result = math::crc64(info->name, result);
- result += static_cast<std::uint64_t>(info->place_voxel);
+
+ if(info->place_voxel) {
+ result += static_cast<std::uint64_t>(info->place_voxel->get_id());
+ }
}
return result;
|
