From f9eca41f3a8415a8463f754c72518c556f7d869b Mon Sep 17 00:00:00 2001 From: "Jason S. Ninneman" Date: Fri, 26 May 2017 16:34:16 -0700 Subject: [PATCH] Ensure the ZZZZ magic word is reproducible. This happens by making the SEED command also regenerate the magic word. --- main.c | 2 ++ tests/dwarf.chk | 4 ++-- tests/dwarf.log | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/main.c b/main.c index 7834084..d84e4f2 100644 --- a/main.c +++ b/main.c @@ -160,6 +160,8 @@ static bool fallback_handler(signed char *buf) if (sscanf(buf, "seed %ld", &sv) == 1) { set_seed(sv); printf("Seed set to %ld\n", sv); + // here we reconfigure any global game state that uses random numbers + ZZWORD=RNDVOC(3,0)+MESH*2; return true; } return false; diff --git a/tests/dwarf.chk b/tests/dwarf.chk index a0aa7e8..ee767e1 100644 --- a/tests/dwarf.chk +++ b/tests/dwarf.chk @@ -7,8 +7,8 @@ You are standing at the end of a road before a small brick building. Around you is a forest. A small stream flows out of the building and down a gully. -> seed 1495752222 -Seed set to 1495752222 +> seed 1494912171 +Seed set to 1494912171 You're in front of building. diff --git a/tests/dwarf.log b/tests/dwarf.log index 9f1bd0f..b50a35f 100644 --- a/tests/dwarf.log +++ b/tests/dwarf.log @@ -1,6 +1,6 @@ ## Death by dwarf. n -seed 1495752222 +seed 1494912171 in take keys take lamp -- 2.31.1