From aa2b9dab74f4fdeef89a6f74dfa3fcd97aec0ba0 Mon Sep 17 00:00:00 2001 From: qndel Date: Sun, 7 Aug 2022 02:36:09 +0200 Subject: [PATCH] fix debug questmap command (#5206) --- Source/debug.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Source/debug.cpp b/Source/debug.cpp index 9a8ad0a59..a8a676c22 100644 --- a/Source/debug.cpp +++ b/Source/debug.cpp @@ -238,6 +238,11 @@ std::string DebugCmdLoadQuestMap(const string_view parameter) if (!MyPlayer->isOnLevel(quest._qlevel)) { StartNewLvl(*MyPlayer, (quest._qlevel != 21) ? interface_mode::WM_DIABNEXTLVL : interface_mode::WM_DIABTOWNWARP, quest._qlevel); ProcessMessages(); + // Workaround for SDL_PollEvent: + // StartNewLvl pushes a new event with SDL_PushEvent. + // ProcessMessages calls SDL_PollEvent but SDL ignores the new pushed event. + // Calling SDL_PollEvent again fixes this. + ProcessMessages(); } setlvltype = quest._qlvltype;