1
0
mirror of https://github.com/p2r3/bareiron.git synced 2025-10-02 07:35:08 +02:00

improve item-to-block mapping

This commit is contained in:
p2r3
2025-08-12 22:29:36 +03:00
parent fceb8e4df1
commit b9e2759786
3 changed files with 263 additions and 6 deletions

View File

@@ -429,7 +429,7 @@ int cs_useItemOn (int client_fd) {
if (getPlayerData(client_fd, &player)) return 1;
uint16_t item = player->inventory_items[player->hotbar];
uint8_t block = item == 320 ? B_crafting_table : I_to_B[item]; // hack!!
uint8_t block = I_to_B(item);
// if the selected item doesn't correspond to a block, exit
if (block == 0) return 0;