summaryrefslogtreecommitdiffstats
path: root/game/client/experiments.cc
diff options
context:
space:
mode:
authoruntodesu <kirill@untode.su>2025-09-12 14:09:34 +0500
committeruntodesu <kirill@untode.su>2025-09-12 14:09:34 +0500
commit73cbcdd6e8c849e32abbf9757e603e6a6654e870 (patch)
tree136e1aef82a25c31552b8990952a7607cfd4708e /game/client/experiments.cc
parente9076f22fe2a49d1cd8933e54b7b00c5dd943269 (diff)
downloadvoxelius-73cbcdd6e8c849e32abbf9757e603e6a6654e870.tar.bz2
voxelius-73cbcdd6e8c849e32abbf9757e603e6a6654e870.zip
Metaitems
Diffstat (limited to 'game/client/experiments.cc')
-rw-r--r--game/client/experiments.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/game/client/experiments.cc b/game/client/experiments.cc
index b947012..8b0b526 100644
--- a/game/client/experiments.cc
+++ b/game/client/experiments.cc
@@ -73,9 +73,12 @@ void experiments::attack(void)
void experiments::interact(void)
{
- if(auto info = world::item_registry::find(gui::hotbar::slots[gui::hotbar::active_slot])) {
- if(info->place_voxel) {
- globals::dimension->set_voxel(info->place_voxel, world::player_target::coord + world::player_target::normal);
+ auto active_item = gui::hotbar::slots[gui::hotbar::active_slot];
+
+ if(active_item) {
+ if(auto place_voxel = active_item->get_place_voxel()) {
+ globals::dimension->set_voxel(place_voxel, world::player_target::coord + world::player_target::normal);
+ return;
}
}
}