diff options
author | sfan5 <sfan5@live.de> | 2022-05-21 20:29:44 +0200 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2022-06-03 21:48:52 +0200 |
commit | 575caa8015fe420ce5e709d6c137036dfc0262ef (patch) | |
tree | e3ea30432afdcf9adaeb6868da03afdc12ad4c9a /src/client/game.cpp | |
parent | 5f3af7d18b528e502e2cf09e0f46cc892df98dd4 (diff) | |
download | minetest-575caa8015fe420ce5e709d6c137036dfc0262ef.tar.gz minetest-575caa8015fe420ce5e709d6c137036dfc0262ef.tar.bz2 minetest-575caa8015fe420ce5e709d6c137036dfc0262ef.zip |
Properly keep noclip state in Game and ClientMap
Diffstat (limited to 'src/client/game.cpp')
-rw-r--r-- | src/client/game.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/client/game.cpp b/src/client/game.cpp index f93bd34a3..d6e0cc8b8 100644 --- a/src/client/game.cpp +++ b/src/client/game.cpp @@ -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 { |