From: Holger Schemel Date: Mon, 21 Dec 2020 22:47:24 +0000 (+0100) Subject: fixed delaying immediate events after game status has changed X-Git-Tag: 4.2.2.0~16 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=afbcadc683ad6307c3a9cdbf1d7f3f247690a1b1;p=rocksndiamonds.git fixed delaying immediate events after game status has changed --- diff --git a/src/events.c b/src/events.c index 1a6ac788..2bc1aff0 100644 --- a/src/events.c +++ b/src/events.c @@ -214,6 +214,8 @@ static void HandleEvents(void) while (NextValidEvent(&event)) { + int game_status_last = game_status; + switch (event.type) { case EVENT_BUTTONPRESS: @@ -264,6 +266,10 @@ static void HandleEvents(void) break; } + // always handle events within delay period if game status has changed + if (game_status != game_status_last) + ResetDelayCounter(&event_frame_delay); + // do not handle events for longer than standard frame delay period if (DelayReached(&event_frame_delay, event_frame_delay_value)) break;