aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWuzzy <wuzzy2@mail.ru>2021-07-12 18:32:18 +0000
committerGitHub <noreply@github.com>2021-07-12 20:32:18 +0200
commitb7b5aad02758ae897fc0239f50f93e04d085ceed (patch)
treec2a30ed73e3ae500a1e2368b12a0e52eed46c5c1
parent5c89a0e12a1e679180b14bf92bdcdb1614e3982e (diff)
downloadminetest-b7b5aad02758ae897fc0239f50f93e04d085ceed.tar.gz
minetest-b7b5aad02758ae897fc0239f50f93e04d085ceed.tar.bz2
minetest-b7b5aad02758ae897fc0239f50f93e04d085ceed.zip
Fix revoke debug privs not reliably turn off stuff (#11409)
-rw-r--r--src/client/game.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/client/game.cpp b/src/client/game.cpp
index 134c74d5d..85dd8f4bb 100644
--- a/src/client/game.cpp
+++ b/src/client/game.cpp
@@ -677,7 +677,7 @@ protected:
bool handleCallbacks();
void processQueues();
void updateProfilers(const RunStats &stats, const FpsControl &draw_times, f32 dtime);
- void updateBasicDebugState();
+ void updateDebugState();
void updateStats(RunStats *stats, const FpsControl &draw_times, f32 dtime);
void updateProfilerGraphs(ProfilerGraph *graph);
@@ -1123,7 +1123,7 @@ void Game::run()
updatePlayerControl(cam_view);
step(&dtime);
processClientEvents(&cam_view_target);
- updateBasicDebugState();
+ updateDebugState();
updateCamera(draw_times.busy_time, dtime);
updateSound(dtime);
processPlayerInteraction(dtime, m_game_ui->m_flags.show_hud,
@@ -1728,18 +1728,24 @@ void Game::processQueues()
shader_src->processQueue();
}
-void Game::updateBasicDebugState()
+void Game::updateDebugState()
{
+ bool has_basic_debug = client->checkPrivilege("basic_debug");
+ bool has_debug = client->checkPrivilege("debug");
+
if (m_game_ui->m_flags.show_basic_debug) {
- if (!client->checkPrivilege("basic_debug")) {
+ if (!has_basic_debug) {
m_game_ui->m_flags.show_basic_debug = false;
- hud->disableBlockBounds();
}
} else if (m_game_ui->m_flags.show_minimal_debug) {
- if (client->checkPrivilege("basic_debug")) {
+ if (has_basic_debug) {
m_game_ui->m_flags.show_basic_debug = true;
}
}
+ if (!has_basic_debug)
+ hud->disableBlockBounds();
+ if (!has_debug)
+ draw_control->show_wireframe = false;
}
void Game::updateProfilers(const RunStats &stats, const FpsControl &draw_times,