[comp.sources.games] v02i048: world - sci-fi adventure game, Patch1

games-request@tekred.TEK.COM (09/05/87)

Submitted by: "J.D. McDonald " <mcdonald%uxe.cso.uiuc.edu@uxc.cso.uiuc.edu>
Comp.sources.games: Volume 2, Issue 48
Archive-name: world/Patch1

	[Just save this file and pass it to 'patch'.   -br]

[[Here is the first official bug fix for my game "World". It includes
all the real bugs that have been reported. It also fixes a few problems
some people have had compiling. There have been bugs reported when
compiling it on the IBM-PC with Turbo C; these, including the problem
with save files not working, probably have to do with the lf vs cr-lf
problem in MS-DOS files. I don't have Turbo C so those who do will
have to work it out themselves. The business with the EXTERN is for the
benefit of Turbo C.
   The game bug fixes include:
       Identifying your pants.
       Automatic door unlocking.
       Wearing your boots.
       Taking the fish. 
   The rest are just improvements in the programming.

Doug McDonald]]


*** vtext.dat	Thu Sep  3 18:58:12 1987
--- ../vtext.dat	Thu Sep  3 17:01:02 1987
***************
*** 28,34 ****
  0026    An adjective cannot modify "all".
  0027    Something more is necessary after this verb.
  0028    I don't understand that sentence.
! 0029    WORLD. C  Version 1.00 Copyright 1987 J.D. McDonald  GOOD LUCK!
  0030    Don't you dare go back! After you volunteered to come here (and
  0030    get out of latrine duty), you'd die of embarrassment if you
  0030    turned back.
--- 28,34 ----
  0026    An adjective cannot modify "all".
  0027    Something more is necessary after this verb.
  0028    I don't understand that sentence.
! 0029    WORLD. C  Version 1.01 Copyright 1987 J.D. McDonald  GOOD LUCK!
  0030    Don't you dare go back! After you volunteered to come here (and
  0030    get out of latrine duty), you'd die of embarrassment if you
  0030    turned back.
***************
*** 130,136 ****
  0103    If you need general help, answer yes to the prompt.
  0103    If you answer no I will offer hints based on your 
  0103    present situation.
! 0104    You are on your own. 
  0105    Some messages (such as this one) may be too big for the screen.
  0105    If so, you may proceed by typing the 'return' key. If you don't
  0105    like this feature, it may be disabled by the NOMORE command and
--- 130,136 ----
  0103    If you need general help, answer yes to the prompt.
  0103    If you answer no I will offer hints based on your 
  0103    present situation.
! 0104    You don't have the key. 
  0105    Some messages (such as this one) may be too big for the screen.
  0105    If so, you may proceed by typing the 'return' key. If you don't
  0105    like this feature, it may be disabled by the NOMORE command and
*** arrays.h	Thu Sep  3 18:26:04 1987
--- ../arrays.h	Thu Sep  3 17:00:15 1987
***************
*** 1,7 ****
  
  /* The arrays declared elsewhere are used starting with index 0;
     those declared below starting with index 1     */
!   int  gtext[5];
!   short locdat[LOCNUM+1], odistb[OBJMX2+1];
!   short obnoun[OBJMAX+1], obadjv[OBJMAX+1], obw3[OBJMAX+1];
!   short obw4[OBJMAX+1], obpprp[OBJMAX+1], obimpr[OBJMAX+1], obloc[MOVMAX+1];
--- 1,8 ----
  
  /* The arrays declared elsewhere are used starting with index 0;
     those declared below starting with index 1     */
!   extern int  gtext[5];
!   extern short locdat[LOCNUM+1], odistb[OBJMX2+1];
!   extern short obnoun[OBJMAX+1], obadjv[OBJMAX+1], obw3[OBJMAX+1];
!   extern short obw4[OBJMAX+1], obpprp[OBJMAX+1], obimpr[OBJMAX+1]
!       , obloc[MOVMAX+1];
*** variab.h	Thu Sep  3 18:24:15 1987
--- ../variab.h	Thu Sep  3 17:00:22 1987
***************
*** 1,16 ****
  
!   int horflg, wirelc[6], punct, three[3] ,eolflg ,lptr ,dotflg ,clause;  
!   int zadjs[12], zobjs[12], ziadj, ziobj, zpdo, zpio, zactor, zadvrb;
!   int zverb, znumb, zall, zbut;
!   int wrdnum[30], wrdtyp[30], adverb, actor;
!   int dobjs[30], iobj, doadjs[12], ioadj, prepdo, prepio;
!   int numdo, butflg, allflg, turns, loc, oldloc, oldlc2, brfflg;
!   int deadf, dirty, nonext ,spcloc;
!   int fshlif, noshoe, daytim, martim ,marflg[9] ,oextim, rdietm;
!   int rvtim, gvtim, eattim, easttm, filmtm, screef;
!   int filmst, machst, fimage, dial1, dial2, dial1x, dial2x;
!   int wwflag, kmax, xindnt, slflag, more, nomor, rmove, chgact;
!   int eastsc, cactsc, diesc, bonus, jackpo, lpill, pbstat, decset;
!   int raset, dcombi, chaset, chaser, guardl;
!   char outst2[66];
!   char inbuf[128];
--- 1,16 ----
  
!   EXTERN int horflg, wirelc[6], punct, three[3] ,eolflg ,lptr ,dotflg ,clause;  
!   EXTERN int zadjs[12], zobjs[12], ziadj, ziobj, zpdo, zpio, zactor, zadvrb;
!   EXTERN int zverb, znumb, zall, zbut;
!   EXTERN int wrdnum[30], wrdtyp[30], adverb, actor;
!   EXTERN int dobjs[30], iobj, doadjs[12], ioadj, prepdo, prepio;
!   EXTERN int numdo, butflg, allflg, turns, loc, oldloc, oldlc2, brfflg;
!   EXTERN int deadf, dirty, nonext ,spcloc;
!   EXTERN int fshlif, noshoe, daytim, martim ,marflg[9] ,oextim, rdietm;
!   EXTERN int rvtim, gvtim, eattim, easttm, filmtm, screef;
!   EXTERN int filmst, machst, fimage, dial1, dial2, dial1x, dial2x;
!   EXTERN int wwflag, kmax, xindnt, slflag, more, nomor, rmove, chgact;
!   EXTERN int eastsc, cactsc, diesc, bonus, jackpo, lpill, pbstat, decset;
!   EXTERN int raset, dcombi, chaset, chaser, guardl;
!   EXTERN char outst2[66];
!   EXTERN char inbuf[128];
*** world.c	Thu Sep  3 18:23:11 1987
--- ../world.c	Thu Sep  3 16:58:58 1987
***************
*** 1,3 ****
--- 1,4 ----
+ #define EXTERN 
  
  #include "parame.inc"
  #include "variab.h"
***************
*** 241,247 ****
  lab9990:
      endsl();
  lab9999:
!     ;
  }
  
  /* end of main program  */
--- 242,248 ----
  lab9990:
      endsl();
  lab9999:
!     return ;
  }
  
  /* end of main program  */
*** demons.c	Thu Sep  3 18:22:28 1987
--- ../demons.c	Thu Sep  3 16:59:43 1987
***************
*** 1,3 ****
--- 1,5 ----
+ #define EXTERN extern
+ 
  #include "parame.inc"
  #include "variab.h"
  #include "arrays.h"
*** motion.c	Thu Sep  3 18:24:13 1987
--- ../motion.c	Thu Sep  3 16:59:38 1987
***************
*** 1,3 ****
--- 1,5 ----
+ #define EXTERN extern
+ 
  #include "parame.inc"
  #include "variab.h"
  #include "arrays.h"
*** helper.c	Thu Sep  3 18:19:31 1987
--- ../helper.c	Thu Sep  3 18:36:41 1987
***************
*** 1,3 ****
--- 1,5 ----
+ #define EXTERN extern
+ 
  #include <stdio.h>
  #include "parame.inc"
  #include "variab.h"
***************
*** 33,38 ****
--- 35,44 ----
  	start += 1;
  	oldpos = -1;
  	q1text_dat = open(Q1TEXT, 0);
+         if(q1text_dat == -1) {
+             printf("Can't open text file q1text.dat.\n");
+             exit(0);
+         }
      }
      z = (long) ((unsigned long) rtext[point]);
      filepos = z * 2 & ~1023l;
***************
*** 84,90 ****
  	}
  	if (wwflag == 0)
  	    linout(outst2, kmax + 1);
!     } while (z < rtext[point + 1]);
  }
  
  vlocat(i, h)
--- 90,96 ----
  	}
  	if (wwflag == 0)
  	    linout(outst2, kmax + 1);
!     } while (z < (long) ( (unsigned long) rtext[point + 1] ) );
  }
  
  vlocat(i, h)
***************
*** 578,589 ****
  			result = RPANT;
  		    else
  			result = LPANT;
! 		} else if (wrdnum[0] == DROP)
  		    if (((g1 == 1) || (g1 == 3)) && g2 != 1 && g2 != 3)
  			result = RPANT;
! 		if (((g2 == 1) || (g2 == 3)) && g1 != 1 && g1 != 3)
! 		    result = LPANT;
! 		else
  		    result = -1;
  	    } else if (don == SHIRT) {
  		itsher(RSHIRT, &g1);
--- 584,595 ----
  			result = RPANT;
  		    else
  			result = LPANT;
! 		} else if (wrdnum[0] == DROP) {
  		    if (((g1 == 1) || (g1 == 3)) && g2 != 1 && g2 != 3)
  			result = RPANT;
! 		    if (((g2 == 1) || (g2 == 3)) && g1 != 1 && g1 != 3)
! 		        result = LPANT;
! 		} else
  		    result = -1;
  	    } else if (don == SHIRT) {
  		itsher(RSHIRT, &g1);
***************
*** 898,906 ****
--- 904,915 ----
      return ((q * 327) > (j & 32767));
  }
  
+ extern char *gets();
+ 
  yesx(spk)
      int             spk;
  {
+     char *eoferr;
      char            ans[90];
      /* ask question, and wait for reply from him */
  
***************
*** 909,918 ****
      more = 0;
      while (1) {
  	linout("?", 2001);
! 	gets(ans);
  	more = 1;
  	if (strcmp(ans, "Y") == 0 || strcmp(ans, "YES") == 0
! 	    || strcmp(ans, "y") == 0 || strcmp(ans, "yes") == 0)
  	    return (1);
  	else if (strcmp(ans, "N") == 0 || strcmp(ans, "NO") == 0
  		 || strcmp(ans, "n") == 0 || strcmp(ans, "no") == 0)
--- 918,928 ----
      more = 0;
      while (1) {
  	linout("?", 2001);
! 	eoferr = gets(ans);
  	more = 1;
  	if (strcmp(ans, "Y") == 0 || strcmp(ans, "YES") == 0
! 	    || strcmp(ans, "y") == 0 || strcmp(ans, "yes") == 0
!             || eoferr == (char *) 0)
  	    return (1);
  	else if (strcmp(ans, "N") == 0 || strcmp(ans, "NO") == 0
  		 || strcmp(ans, "n") == 0 || strcmp(ans, "no") == 0)
***************
*** 926,935 ****
  {
      /* write a prompt, then read a line from the terminal */
  
      int             i, lastpos;
      linout(">", 7001);
  
!     gets(inbuf);
      eolflg = 0;
      lastpos = strlen(inbuf);
      lastpos = (lastpos > 78) ? 78 : lastpos;
--- 936,947 ----
  {
      /* write a prompt, then read a line from the terminal */
  
+     char *eoferr;
      int             i, lastpos;
      linout(">", 7001);
  
!     eoferr = gets(inbuf);
!     if(eoferr == (char *) 0) exit(0);
      eolflg = 0;
      lastpos = strlen(inbuf);
      lastpos = (lastpos > 78) ? 78 : lastpos;
*** parser.c	Thu Sep  3 18:25:08 1987
--- ../parser.c	Thu Sep  3 16:59:19 1987
***************
*** 1,3 ****
--- 1,5 ----
+ #define EXTERN extern
+ 
  #include "parame.inc"
  #include "variab.h"
  #include "arrays.h"
*** verbs1.c	Thu Sep  3 18:21:01 1987
--- ../verbs1.c	Thu Sep  3 16:59:56 1987
***************
*** 1,3 ****
--- 1,5 ----
+ #define EXTERN extern
+ 
  #include "parame.inc"
  #include "variab.h"
  #include "arrays.h"
***************
*** 780,792 ****
  	    if (n == RDOOR || (n == MDOOR && loc == 41))
  		spk = 235;
  	    else if (n == MDOOR || n == GDOOR) {
! 		if (wrdnum[0] == LOCK)
! 		    obimpr[n] |= 4;
! 		else
! 		    obimpr[n] = (obimpr[n] & ~4);
! 		/* ~4=177773 octal */
! 
  		spk = 75;
  	    } else
  		spk = 48;
  	} else
--- 782,796 ----
  	    if (n == RDOOR || (n == MDOOR && loc == 41))
  		spk = 235;
  	    else if (n == MDOOR || n == GDOOR) {
!                 if(obloc[CKEY] == 1000 || obloc[CKEY] == 3000) { 
!  		    if (wrdnum[0] == LOCK)
! 		        obimpr[n] |= 4;
! 		    else
! 		        obimpr[n] = (obimpr[n] & ~4);
! 		    /* ~4=177773 octal */
  		spk = 75;
+                 } else
+                 spk = 104;
  	    } else
  		spk = 48;
  	} else
*** verbs2.c	Thu Sep  3 18:25:50 1987
--- ../verbs2.c	Thu Sep  3 17:00:13 1987
***************
*** 1,3 ****
--- 1,5 ----
+ #define EXTERN extern
+ 
  #include "parame.inc"
  #include "variab.h"
  #include "arrays.h"
***************
*** 1062,1071 ****
  		    spk = 188;
  	    }
  	    /* take fish (from sea) with net.  */
! 
! 	    else if (z == CFISH && loc == 16 &&
! 		     (prepio != WITH || xiobj != BNET))
! 		spk = 80;
  	    /* prevent him from killing wish in watery bag  */
  
  	    else if (z == CFISH && obloc[z] ==
--- 1064,1080 ----
  		    spk = 188;
  	    }
  	    /* take fish (from sea) with net.  */
! 	    else if (z == CFISH && loc == 16 && obimpr[CFISH]/4096 == 1) {
! 	        if (prepio != WITH || xiobj != BNET)
! 		    spk = 80;
!                 else if (obloc[BNET] != 1000)
!                     spk = 91;
!                 else {
!                     obloc[CFISH] = 2000 + BNET;
!                     spk = 81;
!                     obimpr[CFISH] -= 4088;
!                 }
!             }
  	    /* prevent him from killing wish in watery bag  */
  
  	    else if (z == CFISH && obloc[z] ==
***************
*** 1203,1216 ****
  		    else
  			spk = 429;
  		}
- 		/* actual fish taking from sea occurs here  */
- 
- 		if (dobjs[i] == CFISH && loc == 16) {
- 		    if (obloc[BNET] == 1000)
- 			obloc[CFISH] = 2000 + BNET;
- 		    else
- 			spk = 91;
- 		}
  		/*
  		 * special increment of descriptor pointer if obimpr has 4096
  		 * set 
--- 1212,1217 ----
***************
*** 1432,1438 ****
  	} else if (plce == 2) {
  	    spk = 68;
  	    if (plural)
! 		spk = 147;
  	} else if ((obpprp[d] & 64) != 64 && d != ZDEET)
  	    spk = 85;
  	else if ((d == RPANT && obloc[LPANT] == 3000) ||
--- 1433,1439 ----
  	} else if (plce == 2) {
  	    spk = 68;
  	    if (plural)
! 		spk = 187;
  	} else if ((obpprp[d] & 64) != 64 && d != ZDEET)
  	    spk = 85;
  	else if ((d == RPANT && obloc[LPANT] == 3000) ||