From 0708a945e5fafc1f77e5d7eeb44008ee2e4648be Mon Sep 17 00:00:00 2001 From: p2r3 Date: Thu, 28 Aug 2025 02:30:48 +0300 Subject: [PATCH] make flight a configuration option --- include/globals.h | 2 ++ src/procedures.c | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/include/globals.h b/include/globals.h index 83b8c83..2043f2b 100644 --- a/include/globals.h +++ b/include/globals.h @@ -41,6 +41,8 @@ #define SCALE_MOVEMENT_UPDATES_TO_PLAYER_COUNT // If defined, calculates fluid flow when blocks are updated near fluids #define DO_FLUID_FLOW +// If defined, enables flight for all players +#define ENABLE_PLAYER_FLIGHT // If defined, logs unrecognized packet IDs // #define DEV_LOG_UNKNOWN_PACKETS diff --git a/src/procedures.c b/src/procedures.c index 985b07e..d8dc5b7 100644 --- a/src/procedures.c +++ b/src/procedures.c @@ -254,8 +254,12 @@ void spawnPlayer (PlayerData *player) { // Sync client clock time sc_updateTime(player->client_fd, world_time); - // Give the player flight (for testing) - // sc_playerAbilities(player->client_fd, 0x04); + #ifdef ENABLE_PLAYER_FLIGHT + if (GAMEMODE != 1 && GAMEMODE != 3) { + // Give the player flight (for testing) + sc_playerAbilities(player->client_fd, 0x04); + } + #endif // Calculate player's chunk coordinates short _x = div_floor(player->x, 16), _z = div_floor(player->z, 16);