Skip to content

Commit b7b5aad

Browse files
authoredJul 12, 2021
Fix revoke debug privs not reliably turn off stuff (#11409)
1 parent 5c89a0e commit b7b5aad

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed
 

Diff for: ‎src/client/game.cpp

+12-6
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,7 @@ class Game {
677677
bool handleCallbacks();
678678
void processQueues();
679679
void updateProfilers(const RunStats &stats, const FpsControl &draw_times, f32 dtime);
680-
void updateBasicDebugState();
680+
void updateDebugState();
681681
void updateStats(RunStats *stats, const FpsControl &draw_times, f32 dtime);
682682
void updateProfilerGraphs(ProfilerGraph *graph);
683683

@@ -1123,7 +1123,7 @@ void Game::run()
11231123
updatePlayerControl(cam_view);
11241124
step(&dtime);
11251125
processClientEvents(&cam_view_target);
1126-
updateBasicDebugState();
1126+
updateDebugState();
11271127
updateCamera(draw_times.busy_time, dtime);
11281128
updateSound(dtime);
11291129
processPlayerInteraction(dtime, m_game_ui->m_flags.show_hud,
@@ -1728,18 +1728,24 @@ void Game::processQueues()
17281728
shader_src->processQueue();
17291729
}
17301730

1731-
void Game::updateBasicDebugState()
1731+
void Game::updateDebugState()
17321732
{
1733+
bool has_basic_debug = client->checkPrivilege("basic_debug");
1734+
bool has_debug = client->checkPrivilege("debug");
1735+
17331736
if (m_game_ui->m_flags.show_basic_debug) {
1734-
if (!client->checkPrivilege("basic_debug")) {
1737+
if (!has_basic_debug) {
17351738
m_game_ui->m_flags.show_basic_debug = false;
1736-
hud->disableBlockBounds();
17371739
}
17381740
} else if (m_game_ui->m_flags.show_minimal_debug) {
1739-
if (client->checkPrivilege("basic_debug")) {
1741+
if (has_basic_debug) {
17401742
m_game_ui->m_flags.show_basic_debug = true;
17411743
}
17421744
}
1745+
if (!has_basic_debug)
1746+
hud->disableBlockBounds();
1747+
if (!has_debug)
1748+
draw_control->show_wireframe = false;
17431749
}
17441750

17451751
void Game::updateProfilers(const RunStats &stats, const FpsControl &draw_times,

0 commit comments

Comments
 (0)
Please sign in to comment.