From d0f0b89b3501e7f68708e1703a394c53ded1f0ef Mon Sep 17 00:00:00 2001 From: Panagiotis Vasilopoulos Date: Sat, 4 May 2019 23:26:37 +0300 Subject: [PATCH] More squashed bugs. --- include/basin/player.h | 3 +-- src/block.c | 2 +- src/command.c | 2 +- src/inventory.c | 4 +++- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/include/basin/player.h b/include/basin/player.h index 3fb6bd1..f5a015b 100644 --- a/include/basin/player.h +++ b/include/basin/player.h @@ -21,6 +21,7 @@ struct player { struct connection* conn; struct world* world; struct entity* entity; + uint32_t protocol_version; char* name; struct uuid uuid; @@ -77,8 +78,6 @@ void player_hungerUpdate(struct player* player); void player_send_entity_move(struct player* player, struct entity* entity); -void player_receive_packet(struct player* player, struct packet* inp); - void player_tick(struct player* player); void player_kick(struct player* player, char* message); diff --git a/src/block.c b/src/block.c index 9a7c98e..9314c55 100644 --- a/src/block.c +++ b/src/block.c @@ -1206,7 +1206,7 @@ void randomTick_sapling(struct world* world, struct chunk* chunk, block blk, int leaf = BLK_LEAVES_BIG_OAK_2; } uint8_t biome = world_get_biome(world, x, z); - uint8_t vines = type == 0 && (biome == BIOME_SWAMPLAND || biome == BIOME_SWAMPLANDM); + uint8_t vines = type == 0 && (biome == BIOME_SWAMPLAND || biome == BIOME_SWAMPLAND_M); uint8_t cocoa = type == 3; int big = type == 0 && rand() % 10 == 0; if (!big) { diff --git a/src/command.c b/src/command.c index e10fdf0..6000abd 100644 --- a/src/command.c +++ b/src/command.c @@ -113,7 +113,7 @@ void command_list(struct server* server, struct player* player, char** args, siz } struct player* player = (struct player*) value; cptr = xstrncat(cptr, 16, player->name); - END_HASHMAP_ITERATION (players) + END_HASHMAP_ITERATION (players); snprintf(cptr, 32, " (%lu players_by_entity_id total)", players->entry_count); sendMessageToPlayer(player, plist, "gray"); xfree(plist); diff --git a/src/inventory.c b/src/inventory.c index 7c877c3..d5add2d 100644 --- a/src/inventory.c +++ b/src/inventory.c @@ -8,6 +8,7 @@ #include "basin/packet.h" #include #include +#include #include #include #include @@ -176,7 +177,8 @@ int inventory_add(struct player* player, struct inventory* inv, struct slot* slo struct slot* sub_slot = inventory_get(player, inv, i); if (sub_slot == NULL) { sub_slot = pmalloc(inv->pool, sizeof(struct slot)); - slot_duplicate(slot, sub_slot); + struct mempool* pool = mempool_new(); + slot_duplicate(pool, slot, sub_slot); inventory_set_slot(player, inv, i, sub_slot, broadcast); return 0; }