X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=main.c;h=249fdee3d06324186e13b6c10c963eb31710ff0c;hb=ba1369310d6f98808fec143e00e0d9f800833bd7;hp=487eecfca84895df1c7a215ea015c559e71426d1;hpb=cf219e920bb038c9ac2c879adcfd048dc13bf3bc;p=open-adventure.git diff --git a/main.c b/main.c index 487eecf..249fdee 100644 --- a/main.c +++ b/main.c @@ -7,7 +7,6 @@ #include #include #include -#include #include "main.h" #include "misc.h" @@ -18,7 +17,6 @@ long ABB[186], ATAB[331], ATLOC[186], BLKLIN = true, DFLAG, PARMS[26], PLACE[101], PTEXT[101], RTEXT[278], SETUP = 0, TABSIZ = 330; signed char INLINE[LINESIZE+1], MAP1[129], MAP2[129]; -signed char raw_input[LINESIZE+1]; long ABBNUM, ACTSPK[36], AMBER, ATTACK, AXE, BACK, BATTER, BEAR, BIRD, BLOOD, BONUS, BOTTLE, CAGE, CAVE, CAVITY, CHAIN, CHASM, CHEST, CHLOC, CHLOC2, @@ -58,7 +56,6 @@ static void do_command(FILE *); int main(int argc, char *argv[]) { int ch; - time_t starttime = time(NULL); /* Adventure (rev 2: 20 treasures) */ @@ -102,7 +99,7 @@ int main(int argc, char *argv[]) { lcgstate.a = 1093; lcgstate.c = 221587; lcgstate.m = 1048576; - set_seed((long)starttime); + set_seed_from_time(); /* Read the database if we have not yet done so */ @@ -135,8 +132,6 @@ L1: SETUP= -1; LIMIT=330; if(NOVICE)LIMIT=1000; - if (logfp) - fprintf(logfp, "seed %ld\n", starttime); for (;;) { do_command(stdin); } @@ -146,7 +141,7 @@ static void do_command(FILE *cmdin) { /* Can't leave cave once it's closing (except by main office). */ -L2: if(!OUTSID(NEWLOC) || NEWLOC == 0 || !CLOSNG) goto L71; + if(!OUTSID(NEWLOC) || NEWLOC == 0 || !CLOSNG) goto L71; RSPEAK(130); NEWLOC=LOC; if(!PANIC)CLOCK2=15; @@ -453,19 +448,8 @@ L2800: WD1=WD2; /* Gee, I don't understand. */ L3000: SETPRM(1,WD1,WD1X); - /* This is a kludge. The command parser we inherited from the base 2.5 - * barfs on numeric tokens. It will fall through to here when it sees - * seed NNNN. Instead of barfing, go straight to the action processor - * where it will examine the raw input. This will fo away when we get - * rid of the obfuscated FORTRANoid input processing. - */ - if (strncmp(raw_input, "seed", 4) == 0) { - I=4090; K=34; - goto Laction; - } else { - RSPEAK(254); - goto L2600; - } + RSPEAK(254); + goto L2600; /* Verb and object analysis moved to separate module. */