From 9f80a278a6f188c8e9131df0684bad14a07491ee Mon Sep 17 00:00:00 2001 From: untodesu Date: Fri, 21 Mar 2025 18:16:40 +0500 Subject: Toggles system rework, added flight pmove mode - Reworked toggles to use a constant-styled enumerations - Added TOGGLE_PM_FLIGHT and an according movement mode. Now server-side just doesn't simulate gravity altogether for players, instead relying on whatever the client provides which works fine for now. Closes #12 --- game/client/game.cc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'game/client/game.cc') diff --git a/game/client/game.cc b/game/client/game.cc index 72e1dc5..af6fba6 100644 --- a/game/client/game.cc +++ b/game/client/game.cc @@ -354,6 +354,8 @@ void client_game::init(void) void client_game::init_late(void) { + toggles::init_late(); + sound::init_late(); language::init_late(); @@ -498,7 +500,14 @@ void client_game::fixed_update_late(void) void client_game::update(void) { + if(session::is_ingame()) { + if(toggles::get(TOGGLE_PM_FLIGHT)) + globals::dimension->entities.remove(globals::player); + else globals::dimension->entities.emplace_or_replace(globals::player); + } + sound::update(); + listener::update(); interpolation::update(); @@ -616,7 +625,7 @@ void client_game::layout(void) } if(!globals::gui_screen || (globals::gui_screen == GUI_CHAT)) { - if(toggles::draw_metrics && !client_game::hide_hud) { + if(toggles::get(TOGGLE_METRICS_UI) && !client_game::hide_hud) { // This contains Minecraft-esque debug information // about the hardware, world state and other // things that might be uesful -- cgit