From d714557da36accf4bf50e7987283606b71f503ec Mon Sep 17 00:00:00 2001 From: LightyPon <40740201+LightyPon@users.noreply.github.com> Date: Fri, 5 Oct 2018 16:14:10 +0200 Subject: [PATCH] Fix WTS not working after map change Unless this has some other purpose I'm not aware of, it's useless code which only breaks WTS and requires hud_reloadscheme to fix. --- src/hooks/visual/PaintTraverse.cpp | 40 +----------------------------- 1 file changed, 1 insertion(+), 39 deletions(-) diff --git a/src/hooks/visual/PaintTraverse.cpp b/src/hooks/visual/PaintTraverse.cpp index c1dfed67..121a9a95 100644 --- a/src/hooks/visual/PaintTraverse.cpp +++ b/src/hooks/visual/PaintTraverse.cpp @@ -40,14 +40,10 @@ DEFINE_HOOKED_METHOD(PaintTraverse, void, vgui::IPanel *this_, unsigned int panel, bool force, bool allow_force) { static bool textures_loaded = false; - static unsigned long panel_focus = 0; static unsigned long panel_scope = 0; - static unsigned long panel_top = 0; - static bool cur, draw_flag = false; - static bool call_default = true; + static bool cur; static ConVar *software_cursor = g_ICvar->FindVar("cl_software_cursor"); static const char *name; - static std::string name_s, name_stripped, reason_stripped; #if ENABLE_VISUALS if (!textures_loaded) @@ -175,33 +171,6 @@ DEFINE_HOOKED_METHOD(PaintTraverse, void, vgui::IPanel *this_, original::PaintTraverse(this_, panel, force, allow_force); // To avoid threading problems. - if (panel == panel_top) - draw_flag = true; - if (!isHackActive()) - return; - - if (!panel_top) - { - name = g_IPanel->GetName(panel); - if (strlen(name) > 4) - { - if (name[0] == 'M' && name[3] == 'S') - { - panel_top = panel; - } - } - } - if (!panel_focus) - { - name = g_IPanel->GetName(panel); - if (strlen(name) > 5) - { - if (name[0] == 'F' && name[5] == 'O') - { - panel_focus = panel; - } - } - } if (!panel_scope) { name = g_IPanel->GetName(panel); @@ -215,13 +184,6 @@ DEFINE_HOOKED_METHOD(PaintTraverse, void, vgui::IPanel *this_, g_Settings.bInvalid = true; } - if (panel != panel_focus) - return; - g_IPanel->SetTopmostPopup(panel_focus, true); - if (!draw_flag) - return; - draw_flag = false; - if (disable_visuals) return;