From 172dbaeda7b6d80352f47793a5b9fd7481e56234 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Madar=C3=A1sz?= Date: Sun, 17 Jan 2021 16:06:56 +0100 Subject: [PATCH] code: small tweaks --- code/apps/server/source/main.c | 2 +- code/apps/server/source/network.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/code/apps/server/source/main.c b/code/apps/server/source/main.c index 79e0dbc..48725a8 100644 --- a/code/apps/server/source/main.c +++ b/code/apps/server/source/main.c @@ -8,7 +8,7 @@ #define DEFAULT_WORLD_SEED 302097 #define DEFAULT_BLOCK_SIZE 64 /* amount of units within a block (single axis) */ -#define DEFAULT_CHUNK_SIZE 16 /* amount of blocks within a chunk (single axis) */ +#define DEFAULT_CHUNK_SIZE 3 /* amount of blocks within a chunk (single axis) */ #define DEFAULT_WORLD_SIZE 8 /* amount of chunks within a world (single axis) */ #define IF(call) do { \ diff --git a/code/apps/server/source/network.c b/code/apps/server/source/network.c index 9d448c4..ac925d1 100644 --- a/code/apps/server/source/network.c +++ b/code/apps/server/source/network.c @@ -70,7 +70,7 @@ int32_t network_server_tick(void) { ecs_set(world_ecs(), e, position, {0, 0}); ecs_set(world_ecs(), e, netclient, {peer_id}); - event.peer->data = (void*)e; + event.peer->data = (void*)((uint32_t)e); librg_entity_track(world_tracker(), e); librg_entity_owner_set(world_tracker(), e, peer_id); @@ -81,7 +81,7 @@ int32_t network_server_tick(void) { case ENET_EVENT_TYPE_DISCONNECT: case ENET_EVENT_TYPE_DISCONNECT_TIMEOUT: { zpl_printf("[INFO] A user %d disconnected.\n", event.peer->incomingPeerID); - ecs_entity_t e = (ecs_entity_t)event.peer->data; + ecs_entity_t e = (ecs_entity_t)((uint32_t)event.peer->data); librg_entity_untrack(world_tracker(), e); ecs_delete(world_ecs(), e); } break;