From e9076f22fe2a49d1cd8933e54b7b00c5dd943269 Mon Sep 17 00:00:00 2001 From: untodesu Date: Fri, 12 Sep 2025 13:33:52 +0500 Subject: It compiles --- game/shared/world/item_registry.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'game/shared/world/item_registry.cc') 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(info->place_voxel); + + if(info->place_voxel) { + result += static_cast(info->place_voxel->get_id()); + } } return result; -- cgit