]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/client/game.cpp
Properly keep noclip state in Game and ClientMap
[dragonfireclient.git] / src / client / game.cpp
index f93bd34a3b6ff56fb88fddded059bb525adffd3f..d6e0cc8b8e26bc8632f7919f069819f55b6408a9 100644 (file)
@@ -1743,6 +1743,8 @@ void Game::processQueues()
 void Game::updateDebugState()
 {
        LocalPlayer *player = client->getEnv().getLocalPlayer();
+
+       // debug UI and wireframe
        bool has_debug = client->checkPrivilege("debug");
        bool has_basic_debug = has_debug || (player->hud_flags & HUD_FLAG_BASIC_DEBUG);
 
@@ -1757,6 +1759,9 @@ void Game::updateDebugState()
                hud->disableBlockBounds();
        if (!has_debug)
                draw_control->show_wireframe = false;
+
+       // noclip
+       draw_control->allow_noclip = m_cache_enable_noclip && client->checkPrivilege("noclip");
 }
 
 void Game::updateProfilers(const RunStats &stats, const FpsControl &draw_times,
@@ -3762,7 +3767,10 @@ void Game::updateFrame(ProfilerGraph *graph, RunStats *stats, f32 dtime,
        float direct_brightness;
        bool sunlight_seen;
 
-       if (m_cache_enable_noclip && m_cache_enable_free_move) {
+       // When in noclip mode force same sky brightness as above ground so you
+       // can see properly
+       if (draw_control->allow_noclip && m_cache_enable_free_move &&
+               client->checkPrivilege("fly")) {
                direct_brightness = time_brightness;
                sunlight_seen = true;
        } else {