From b1fea228bef90041f3560c5a1559d6a3c96673b5 Mon Sep 17 00:00:00 2001 From: Mitch Richters Date: Sat, 20 Nov 2021 22:38:54 +1100 Subject: [PATCH] - `D_ProcessEvents()`: Fix bad setup with `delayedevents` array that was holding pointers to items in the `events[]` array instead of making a copy. --- src/common/engine/d_event.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/engine/d_event.cpp b/src/common/engine/d_event.cpp index cd92a7229..52fedd428 100644 --- a/src/common/engine/d_event.cpp +++ b/src/common/engine/d_event.cpp @@ -68,7 +68,7 @@ CVAR(Bool, m_filter, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) void D_ProcessEvents (void) { bool keywasdown[NUM_KEYS] = { false }; - TArray delayedevents; + TArray delayedevents; while (eventtail != eventhead) { @@ -77,7 +77,7 @@ void D_ProcessEvents (void) if (ev->type == EV_KeyUp && keywasdown[ev->data1]) { - delayedevents.Push(ev); + delayedevents.Push(*ev); continue; } @@ -99,7 +99,7 @@ void D_ProcessEvents (void) for (auto& ev: delayedevents) { - D_PostEvent(ev); + D_PostEvent(&ev); } }