make flight a configuration option

This commit is contained in:
p2r3
2025-08-28 02:30:48 +03:00
parent fc327299b4
commit 0708a945e5
2 changed files with 8 additions and 2 deletions

View File

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

View File

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