X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=main.c;h=3c4d448ab56009f5f505b6aeb5510fe211e7ee5e;hb=36a6cbca3449b3a4d298715b065e909333379636;hp=a6027f8136e06637db534a1a3df691a0e8384e3e;hpb=0a87fc9f78c40354068749f93cbbed80e217cd88;p=open-adventure.git diff --git a/main.c b/main.c index a6027f8..3c4d448 100644 --- a/main.c +++ b/main.c @@ -19,7 +19,6 @@ #include #include #include -#include #include #include "advent.h" #include "linenoise/linenoise.h" @@ -138,17 +137,8 @@ int main(int argc, char *argv[]) linenoiseHistorySetMaxLen(350); - /* Initialize our LCG PRNG with parameters tested against - * Knuth vol. 2. by the original authors */ - game.lcg_a = 1093; - game.lcg_c = 221587; - game.lcg_m = 1048576; - srand(time(NULL)); - long seedval = (long)rand(); - set_seed(seedval); - /* Initialize game variables */ - initialise(); + long seedval = initialise(); /* Start-up, dwarf stuff */ make_zzword(game.zzword); @@ -1123,12 +1113,12 @@ L2607: wordclear(&command.wd2); } else { /* FIXME: Magic numbers related to vocabulary */ - if (!((V1 != 1000 + WATER && V1 != 1000 + OIL) || - (V2 != 1000 + PLANT && V2 != 1000 + DOOR))) { + if (!((V1 != PROMOTE_WORD(WATER) && V1 != PROMOTE_WORD(OIL)) || + (V2 != PROMOTE_WORD(PLANT) && V2 != PROMOTE_WORD(DOOR)))) { if (AT(V2 - 1000)) command.wd2 = token_to_packed("POUR"); } - if (V1 == 1000 + CAGE && V2 == 1000 + BIRD && HERE(CAGE) && HERE(BIRD)) + if (V1 == PROMOTE_WORD(CAGE) && V2 == PROMOTE_WORD(BIRD) && HERE(CAGE) && HERE(BIRD)) command.wd1 = token_to_packed("CATCH"); } L2620: