aboutsummaryrefslogtreecommitdiffstats
path: root/keyboard.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboard.c')
-rw-r--r--keyboard.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/keyboard.c b/keyboard.c
index 06d57b9..69f4732 100644
--- a/keyboard.c
+++ b/keyboard.c
@@ -26,6 +26,12 @@ static int queuedkeys = 0;
*/
void push_key(SDL_KeyboardEvent *ke)
{
+ /* Hack to add some nondeterminism into the gameid's */
+ if ( !gp.have_id ) {
+ gp.gameid = (gp.gameid << 5 | gp.gameid >> 59)
+ + ((uint64_t)SDL_GetTicks() << 32) + genrand_int32();
+ }
+
if ( queuedkeys >= KEYQUEUELEN )
return; /* Drop it */