Skip to content

Commit

Permalink
[cheat] Fixed a random crash on cheat exit/restart.
Browse files Browse the repository at this point in the history
  • Loading branch information
oxiKKK committed May 31, 2023
1 parent d2e00b1 commit 6c82921
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/cheat/ui/OxWareUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,14 @@ void COxWareUI::destroy()

CConsole::the().info("Destroying cheat UI...");

CEngineInput::the().toggle_ingame_clientdll_mouse(true); // call this before the restoration, so that we eliminate bugs when not in relative mode.
CEngineInput::the().toggle_ingame_input(true);
// if we're exiting/restarting from the game, we don't have to worry about this at all.
// NOTE: This is in order to fix a occasional crash that would happen where the gameUI
// interface would become dangling... (non-nullptr, but invalid memory) so this fixes that.
if (!CoXWARE::the().is_game_exiting_or_restarting())
{
CEngineInput::the().toggle_ingame_clientdll_mouse(true); // call this before the restoration, so that we eliminate bugs when not in relative mode.
CEngineInput::the().toggle_ingame_input(true);
}

destroy_rendering_contexts();

Expand Down

0 comments on commit 6c82921

Please sign in to comment.