More squashed bugs.

This commit is contained in:
Panagiotis Vasilopoulos 2019-05-04 23:26:37 +03:00 committed by Max Bruce
parent ba127a59c8
commit d0f0b89b35
4 changed files with 6 additions and 5 deletions

View File

@ -21,6 +21,7 @@ struct player {
struct connection* conn; struct connection* conn;
struct world* world; struct world* world;
struct entity* entity; struct entity* entity;
uint32_t protocol_version;
char* name; char* name;
struct uuid uuid; 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_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_tick(struct player* player);
void player_kick(struct player* player, char* message); void player_kick(struct player* player, char* message);

View File

@ -1206,7 +1206,7 @@ void randomTick_sapling(struct world* world, struct chunk* chunk, block blk, int
leaf = BLK_LEAVES_BIG_OAK_2; leaf = BLK_LEAVES_BIG_OAK_2;
} }
uint8_t biome = world_get_biome(world, x, z); 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; uint8_t cocoa = type == 3;
int big = type == 0 && rand() % 10 == 0; int big = type == 0 && rand() % 10 == 0;
if (!big) { if (!big) {

View File

@ -113,7 +113,7 @@ void command_list(struct server* server, struct player* player, char** args, siz
} }
struct player* player = (struct player*) value; struct player* player = (struct player*) value;
cptr = xstrncat(cptr, 16, player->name); 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); snprintf(cptr, 32, " (%lu players_by_entity_id total)", players->entry_count);
sendMessageToPlayer(player, plist, "gray"); sendMessageToPlayer(player, plist, "gray");
xfree(plist); xfree(plist);

View File

@ -8,6 +8,7 @@
#include "basin/packet.h" #include "basin/packet.h"
#include <basin/network.h> #include <basin/network.h>
#include <basin/globals.h> #include <basin/globals.h>
#include <basin/player.h>
#include <basin/item.h> #include <basin/item.h>
#include <basin/game.h> #include <basin/game.h>
#include <basin/player.h> #include <basin/player.h>
@ -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); struct slot* sub_slot = inventory_get(player, inv, i);
if (sub_slot == NULL) { if (sub_slot == NULL) {
sub_slot = pmalloc(inv->pool, sizeof(struct slot)); 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); inventory_set_slot(player, inv, i, sub_slot, broadcast);
return 0; return 0;
} }