code: small tweaks

isolation_bkp/dynres
Dominik Madarász 2021-01-17 16:06:56 +01:00
parent 2ed30603c1
commit 172dbaeda7
2 changed files with 3 additions and 3 deletions

View File

@ -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 { \

View File

@ -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;