mirror of
https://github.com/p2r3/bareiron.git
synced 2025-10-01 23:25:09 +02:00
fix compile warnings
This commit is contained in:
@@ -549,14 +549,14 @@ void handlePlayerUseItem (PlayerData *player, short x, short y, short z, uint8_t
|
|||||||
uint8_t target = getBlockAt(x, y, z);
|
uint8_t target = getBlockAt(x, y, z);
|
||||||
if (target == B_crafting_table) {
|
if (target == B_crafting_table) {
|
||||||
sc_openScreen(player->client_fd, 12, "Crafting", 8);
|
sc_openScreen(player->client_fd, 12, "Crafting", 8);
|
||||||
return 0;
|
return;
|
||||||
} else if (target == B_furnace) {
|
} else if (target == B_furnace) {
|
||||||
sc_openScreen(player->client_fd, 14, "Furnace", 7);
|
sc_openScreen(player->client_fd, 14, "Furnace", 7);
|
||||||
return 0;
|
return;
|
||||||
} else if (target == B_composter) {
|
} else if (target == B_composter) {
|
||||||
// Check if the player is holding anything
|
// Check if the player is holding anything
|
||||||
uint8_t *count = &player->inventory_count[player->hotbar];
|
uint8_t *count = &player->inventory_count[player->hotbar];
|
||||||
if (*count == 0) return 0;
|
if (*count == 0) return;
|
||||||
// Check if the item is a valid compost item
|
// Check if the item is a valid compost item
|
||||||
uint16_t item = player->inventory_items[player->hotbar];
|
uint16_t item = player->inventory_items[player->hotbar];
|
||||||
uint32_t compost_chance = isCompostItem(item);
|
uint32_t compost_chance = isCompostItem(item);
|
||||||
@@ -568,7 +568,7 @@ void handlePlayerUseItem (PlayerData *player, short x, short y, short z, uint8_t
|
|||||||
if (fast_rand() < compost_chance) {
|
if (fast_rand() < compost_chance) {
|
||||||
givePlayerItem(player, I_bone_meal, 1);
|
givePlayerItem(player, I_bone_meal, 1);
|
||||||
}
|
}
|
||||||
return 0;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -588,9 +588,9 @@ void handlePlayerUseItem (PlayerData *player, short x, short y, short z, uint8_t
|
|||||||
uint8_t block = I_to_B(*item);
|
uint8_t block = I_to_B(*item);
|
||||||
|
|
||||||
// if the selected item doesn't correspond to a block, exit
|
// if the selected item doesn't correspond to a block, exit
|
||||||
if (block == 0) return 0;
|
if (block == 0) return;
|
||||||
// if the selected slot doesn't hold any items, exit
|
// if the selected slot doesn't hold any items, exit
|
||||||
if (*count == 0) return 0;
|
if (*count == 0) return;
|
||||||
|
|
||||||
// check if the block's placement conditions are met
|
// check if the block's placement conditions are met
|
||||||
if (
|
if (
|
||||||
|
Reference in New Issue
Block a user