projects
/
rocksndiamonds.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2a0a912
)
fixed delaying immediate events after game status has changed
author
Holger Schemel
<info@artsoft.org>
Mon, 21 Dec 2020 22:47:24 +0000
(23:47 +0100)
committer
Holger Schemel
<info@artsoft.org>
Mon, 21 Dec 2020 22:48:04 +0000
(23:48 +0100)
src/events.c
patch
|
blob
|
history
diff --git
a/src/events.c
b/src/events.c
index 1a6ac788b29aab28eca2f5918725cf3aeb09284d..2bc1aff077847a132313588f3c9959ea1fe5571f 100644
(file)
--- 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;