From: Jason S. Ninneman Date: Fri, 26 May 2017 23:34:16 +0000 (-0700) Subject: Ensure the ZZZZ magic word is reproducible. X-Git-Tag: seed~38 X-Git-Url: https://jxself.org/git/?p=open-adventure.git;a=commitdiff_plain;h=f9eca41f3a8415a8463f754c72518c556f7d869b Ensure the ZZZZ magic word is reproducible. This happens by making the SEED command also regenerate the magic word. --- 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