home *** CD-ROM | disk | FTP | other *** search
/ Giga Games 1 / Giga Games.iso / net / usenet / volume12 / larn2 / patch1 < prev   
Encoding:
Internet Message Format  |  1991-05-15  |  12.7 KB

  1. Path: uunet!zephyr.ens.tek.com!master!saab!billr
  2. From: billr@saab.CNA.TEK.COM (Bill Randle)
  3. Newsgroups: comp.sources.games
  4. Subject: v12i067:  larn2 - dungeon type adventure game (V12.3), Patch1
  5. Message-ID: <1229@masterCNA.TEK.COM>
  6. Date: 14 May 91 22:52:45 GMT
  7. Sender: news@masterCNA.TEK.COM
  8. Lines: 383
  9. Approved: billr@saab.CNA.TEK.COM
  10.  
  11. Submitted-by: routley@tle.ENET.DEC.COM (Kevin Routley)
  12. Posting-number: Volume 12, Issue 67
  13. Archive-name: larn2/Patch1
  14. Patch-To: larn2: Volume 12, Issue 54-65
  15. Environment: Unix, VMS, MS-DOS, OS/2, termcap
  16.  
  17.  
  18.  
  19. #! /bin/sh
  20. # This is a shell archive.  Remove anything before this line, then unpack
  21. # it by saving it into a file and typing "sh file".  To overwrite existing
  22. # files, type "sh file -c".  You can also feed this as standard input via
  23. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  24. # will see the following message at the end:
  25. #        "End of shell archive."
  26. # Contents:  patches01
  27. # Wrapped by billr@saab on Tue May 14 15:50:41 1991
  28. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  29. if test -f 'patches01' -a "${1}" != "-c" ; then 
  30.   echo shar: Will not clobber existing file \"'patches01'\"
  31. else
  32. echo shar: Extracting \"'patches01'\" \(11173 characters\)
  33. sed "s/^X//" >'patches01' <<'END_OF_FILE'
  34. X
  35. X*** patchlog.org Mon May 13 21:26:38 1991
  36. X--- patchlog    Mon May 13 21:24:36 1991
  37. X***************
  38. X*** 0 ****
  39. X--- 1,16 ----
  40. X+ Patch 1
  41. X+ =======
  42. X+
  43. X+ Prompted by Pat Ryan, fix a bug in the dropobj() code in main.c that
  44. X+ allowed the player to drop a negative amount of gold.  In the process, fix
  45. X+ the backwards carriage return logic when printing the error response.
  46. X+
  47. X+ Document the new SIG_RETURNS_INT #define introduced by Bill Randle when the
  48. X+ software was posted.
  49. X+
  50. X+ Prompted by Lasse Oestergaard, guard against out-of-bound array references
  51. X+ in movem.c when on the Home level.  Also fixed a bug where a 'smart' monster
  52. X+ would fail to move towards the player when the player was on the boundary.
  53. X+
  54. X+ Prompted by Mitch Gorman, make the EXTRA #define compile and work under
  55. X+ MS-DOS.
  56. X*** patchlev.org    Sat Mar 23 14:08:52 1991
  57. X--- patchlev.h  Mon May 13 21:17:10 1991
  58. X***************
  59. X*** 1,3 ****
  60. X  /* indicate which patches have been applied to Larn.
  61. X  */
  62. X! #define PATCHLEVEL 0
  63. X--- 1,3 ----
  64. X  /* indicate which patches have been applied to Larn.
  65. X  */
  66. X! #define PATCHLEVEL 1
  67. X*** config.org  Sat Jul 07 13:58:52 1990
  68. X--- config.c    Mon May 13 20:32:26 1991
  69. X***************
  70. X*** 73,78 ****
  71. X--- 73,81 ----
  72. X  char ckpfile[PATHLEN];
  73. X  char swapfile[PATHLEN];
  74. X  char larndir[DIRLEN]        = LARNHOME;
  75. X+ # ifdef EXTRA
  76. X+ char diagfile[PATHLEN];        /* the diagnostic filename  */
  77. X+ # endif
  78. X  #   else
  79. X  char savefilename[PATHLEN]  = LARNHOME;
  80. X  char scorefile[PATHLEN]     = LARNHOME;
  81. X*** diag.org    Sat Jul 07 13:47:32 1990
  82. X--- diag.c  Mon May 13 20:32:16 1991
  83. X***************
  84. X*** 24,29 ****
  85. X--- 24,31 ----
  86. X  extern int rmst,maxitm,lasttime;
  87. X  extern char nosignal;
  88. X  
  89. X+ #define max( _a, _b ) (( _a > _b ) ? _a : _b )
  90. X+ 
  91. X  /*
  92. X      ***************************
  93. X      DIAG -- dungeon diagnostics
  94. X***************
  95. X*** 124,129 ****
  96. X--- 126,133 ----
  97. X      lcreat((char*)0);       lprcat("Done Diagnosing . . .");
  98. X      return(0);
  99. X      }
  100. X+ 
  101. X+ #ifndef MSDOS
  102. X  /*
  103. X      subroutine to count the number of occurrences of an object
  104. X   */
  105. X***************
  106. X*** 139,144 ****
  107. X--- 143,149 ----
  108. X                  if (cell[(long) p*MAXX*MAXY+i*MAXY+j].item == l) k++;
  109. X      return(k);
  110. X      }
  111. X+ #endif
  112. X  
  113. X  /*
  114. X      subroutine to draw the whole screen as the player knows it
  115. X*** header.org  Mon Dec 24 14:10:10 1990
  116. X--- header.h    Mon May 13 20:31:28 1991
  117. X***************
  118. X*** 22,27 ****
  119. X--- 22,28 ----
  120. X  #define FORTSNAME   "larn.ftn"
  121. X  #define PLAYERIDS   "larn.pid"
  122. X  #define HOLIFILE    "holidays"
  123. X+ #define DIAGFILE    "Diagfile"
  124. X  #ifdef MSDOS
  125. X  #   define LARNOPTS "larn.opt"
  126. X  #   define SAVEFILE "larn.sav"
  127. X*** io.org  Tue Mar 26 14:39:08 1991
  128. X--- io.c    Mon May 13 20:32:20 1991
  129. X***************
  130. X*** 57,62 ****
  131. X--- 57,66 ----
  132. X  #include "larndefs.h"
  133. X  #include <ctype.h>
  134. X
  135. X+ #ifdef EXTRA
  136. X+ # include "player.h"
  137. X+ #endif
  138. X+
  139. X  #ifdef SYSV /* system III or system V */
  140. X  # ifndef MSDOS
  141. X  #   include <termio.h>
  142. X*** main.org    Tue Mar 26 15:00:36 1991
  143. X--- main.c  Mon May 13 20:32:22 1991
  144. X***************
  145. X*** 167,178 ****
  146. X
  147. X      /* Savefile and swapfile can be given explicitly as options
  148. X       */
  149. X!     if (!savefilename[0]) 
  150. X          {
  151. X          strcpy(savefilename, larndir);
  152. X          strcat(savefilename, SAVEFILE);
  153. X          }
  154. X!     if (!swapfile[0]) 
  155. X          {
  156. X          strcpy(swapfile, larndir);
  157. X          strcat(swapfile, SWAPFILE);
  158. X--- 167,178 ----
  159. X  
  160. X      /* Savefile and swapfile can be given explicitly as options
  161. X       */
  162. X!     if (!savefilename[0])
  163. X          {
  164. X          strcpy(savefilename, larndir);
  165. X          strcat(savefilename, SAVEFILE);
  166. X          }
  167. X!     if (!swapfile[0])
  168. X          {
  169. X          strcpy(swapfile, larndir);
  170. X          strcat(swapfile, SWAPFILE);
  171. X***************
  172. X*** 184,193 ****
  173. X      strcpy(fortfile, larndir);
  174. X      strcpy(playerids, larndir);
  175. X      strcpy(ckpfile, larndir);
  176. X  
  177. X  # else /* MSDOS */
  178. X  
  179. X!     if ((ptr = getenv("HOME")) == 0) 
  180. X          ptr = ".";
  181. X  #ifdef SAVEINHOME
  182. X      /* save file name in home directory */
  183. X--- 184,196 ----
  184. X      strcpy(fortfile, larndir);
  185. X      strcpy(playerids, larndir);
  186. X      strcpy(ckpfile, larndir);
  187. X+ #  ifdef EXTRA
  188. X+     strcpy(diagfile,larndir);
  189. X+ #  endif
  190. X  
  191. X  # else /* MSDOS */
  192. X  
  193. X!     if ((ptr = getenv("HOME")) == 0)
  194. X          ptr = ".";
  195. X  #ifdef SAVEINHOME
  196. X      /* save file name in home directory */
  197. X***************
  198. X*** 220,225 ****
  199. X--- 223,232 ----
  200. X      strcat(holifile, HOLIFILE);     /* the holiday data file name */
  201. X  # endif
  202. X  
  203. X+ # ifdef EXTRA
  204. X+     strcat(diagfile, DIAGFILE);
  205. X+ # endif
  206. X+ 
  207. X  #ifdef VT100
  208. X  /*
  209. X   *  check terminal type to avoid users who have not vt100 type terminals
  210. X***************
  211. X*** 1036,1049 ****
  212. X      {
  213. X      register int i;
  214. X      register char *p;
  215. X!     long amt;
  216. X  
  217. X      p = &item[playerx][playery];
  218. X      while (1)
  219. X          {
  220. X!         if ((i = whatitem("drop"))=='\33')  
  221. X          return;
  222. X!     if (i=='*') 
  223. X          {
  224. X          i = showstr(TRUE);
  225. X          cursors();
  226. X--- 1043,1056 ----
  227. X      {
  228. X      register int i;
  229. X      register char *p;
  230. X!     unsigned long amt;
  231. X  
  232. X      p = &item[playerx][playery];
  233. X      while (1)
  234. X          {
  235. X!         if ((i = whatitem("drop"))=='\33')
  236. X          return;
  237. X!     if (i=='*')
  238. X          {
  239. X          i = showstr(TRUE);
  240. X          cursors();
  241. X***************
  242. X*** 1059,1065 ****
  243. X                  if ((amt=readnum((long)c[GOLD])) == 0) return;
  244. X                  if (amt>c[GOLD])
  245. X                      {
  246. X! #ifndef MSDOS
  247. X              lprcat("\n");
  248. X  #endif MSDOS
  249. X              lprcat("You don't have that much!");
  250. X--- 1066,1072 ----
  251. X                  if ((amt=readnum((long)c[GOLD])) == 0) return;
  252. X                  if (amt>c[GOLD])
  253. X                      {
  254. X! #ifdef MSDOS
  255. X              lprcat("\n");
  256. X  #endif MSDOS
  257. X              lprcat("You don't have that much!");
  258. X*** makefile.org    Sat Mar 23 19:09:40 1991
  259. X--- makefile.pc   Mon May 13 21:15:22 1991
  260. X***************
  261. X*** 31,36 ****
  262. X--- 31,38 ----
  263. X  #   RFCMAIL       - mail messages are RFC822 conformant.  Must be used with
  264. X  #                   MAIL above.
  265. X  #   SAVEINHOME    - put save files in users HOME instead of LARNHOME (default)
  266. X+ #   SIG_RETURNS_INT - define if signal() returns (int *)() instead of
  267. X+ #                   (void *)()
  268. X  #   SYSV          - use system III/V (instead of V7) type ioctl calls
  269. X  #   TIMECHECK     - incorporates code to disable play during working hours (8-5)
  270. X  #   UIDSCORE      - Define to use user id's to manage scoreboard.  Leaving this
  271. X*** movem.org   Sat Mar 23 16:14:34 1991
  272. X--- movem.c Mon May 13 18:03:26 1991
  273. X***************
  274. X*** 311,323 ****
  275. X
  276. X        /* test all spots around the current one being looked at.
  277. X        */
  278. X!       if ( ( curx >= xl && curx < xh ) &&
  279. X!            ( cury >= yl && cury < yh ) )
  280. X            {
  281. X            for (z=1; z<9; z++)
  282. X            {
  283. X            tmpx = curx + diroffx[z] ;
  284. X            tmpy = cury + diroffy[z] ;
  285. X            if (screen[tmpx][tmpy] == 0 )
  286. X                {
  287. X                screen[tmpx][tmpy] = curdist + 1;
  288. X--- 311,324 ----
  289. X  
  290. X        /* test all spots around the current one being looked at.
  291. X        */
  292. X!       if ( ( curx >= xl && curx <= xh ) &&
  293. X!            ( cury >= yl && cury <= yh ) )
  294. X            {
  295. X            for (z=1; z<9; z++)
  296. X            {
  297. X            tmpx = curx + diroffx[z] ;
  298. X            tmpy = cury + diroffy[z] ;
  299. X+           vxy( &tmpx, &tmpy );
  300. X            if (screen[tmpx][tmpy] == 0 )
  301. X                {
  302. X                screen[tmpx][tmpy] = curdist + 1;
  303. X***************
  304. X*** 448,453 ****
  305. X--- 449,459 ----
  306. X      xl=i-1;  yl=j-1;  xh=i+2;  yh=j+2;
  307. X      if (i<playerx) xl++; else if (i>playerx) --xh;
  308. X      if (j<playery) yl++; else if (j>playery) --yh;
  309. X+ 
  310. X+     if (xl < 0) xl = 0;
  311. X+     if (yl < 0) yl = 0;
  312. X+     if (xh > MAXX) xh = MAXX; /* MAXX OK; loop check below is <, not <= */
  313. X+     if (yh > MAXY) yh = MAXY; /* MAXY OK; loop check below is <, not <= */
  314. X  
  315. X      /* check all spots in the range.  find the one that is closest to
  316. X         the player.  if the monster is already next to the player, exit
  317. X*** scores.org  Sun Mar 03 23:59:52 1991
  318. X--- scores.c    Mon May 13 20:32:30 1991
  319. X***************
  320. X*** 72,78 ****
  321. X--- 72,80 ----
  322. X      long moves;         /* number of moves made by player                   */
  323. X      short ac;           /* armor class of player                            */
  324. X      short hp,hpmax;     /* players hitpoints                                */
  325. X+ # ifndef MSDOS
  326. X      short cputime;      /* cpu time needed in seconds                       */
  327. X+ # endif
  328. X      short killed,spused;/* monsters killed and spells cast                  */
  329. X      short usage;        /* usage of the cpu in %                            */
  330. X      short lev;          /* player level                                     */
  331. X***************
  332. X*** 511,519 ****
  333. X--- 513,523 ----
  334. X      register int f,win;
  335. X      char ch,*mod;
  336. X      long zzz,i;
  337. X+ #ifndef MSDOS
  338. X  # ifdef EXTRA
  339. X      struct tms cputime;
  340. X  # endif
  341. X+ #endif
  342. X      if (c[LIFEPROT]>0) /* if life protection */
  343. X          {
  344. X          switch((x>0) ? x : -x)
  345. X***************
  346. X*** 572,579 ****
  347. X--- 576,585 ----
  348. X          time(&zzz);   /* get cpu time -- write out score info */
  349. X          logg.diedtime=zzz;
  350. X  #ifdef EXTRA
  351. X+ # ifndef MSDOS
  352. X          times(&cputime);  /* get cpu time -- write out score info */
  353. X          logg.cputime = i = (cputime.tms_utime + cputime.tms_stime)/60 + c[CPUTIME];
  354. X+ # endif
  355. X          logg.lev=c[LEVEL];          logg.ac=c[AC];
  356. X          logg.hpmax=c[HPMAX];        logg.hp=c[HP];
  357. X          logg.elapsedtime=(zzz-initialtime+59)/60;
  358. X***************
  359. X*** 645,653 ****
  360. X  #ifdef EXTRA
  361. X          if (logg.moves<=0) logg.moves=1;
  362. X          lprintf("  Experience Level: %d,  AC: %d,  HP: %d/%d,  Elapsed Time: %d minutes\n",(long)(logg.lev),(long)(logg.ac),(long)(logg.hp),(long)(logg.hpmax),(long)(logg.elapsedtime));
  363. X          lprintf("  CPU time used: %d seconds,  Machine usage: %d.%02d%%\n",(long)(logg.cputime),(long)(logg.usage/100),(long)(logg.usage%100));
  364. X          lprintf("  BYTES in: %d, out: %d, moves: %d, deaths: %d, spells cast: %d\n",(long)(logg.bytin),(long)(logg.bytout),(long)(logg.moves),(long)(logg.killed),(long)(logg.spused));
  365. X!         lprintf("  out bytes per move: %d,  time per move: %d ms\n",(long)(logg.bytout/logg.moves),(long)((logg.cputime*1000)/logg.moves));
  366. X  #endif
  367. X          }
  368. X          lflush();  lrclose();  return;
  369. X--- 651,665 ----
  370. X  #ifdef EXTRA
  371. X          if (logg.moves<=0) logg.moves=1;
  372. X          lprintf("  Experience Level: %d,  AC: %d,  HP: %d/%d,  Elapsed Time: %d minutes\n",(long)(logg.lev),(long)(logg.ac),(long)(logg.hp),(long)(logg.hpmax),(long)(logg.elapsedtime));
  373. X+ # ifndef MSDOS
  374. X          lprintf("  CPU time used: %d seconds,  Machine usage: %d.%02d%%\n",(long)(logg.cputime),(long)(logg.usage/100),(long)(logg.usage%100));
  375. X+ # endif
  376. X          lprintf("  BYTES in: %d, out: %d, moves: %d, deaths: %d, spells cast: %d\n",(long)(logg.bytin),(long)(logg.bytout),(long)(logg.moves),(long)(logg.killed),(long)(logg.spused));
  377. X!         lprintf("  out bytes per move: %d",(long)(logg.bytout/logg.moves));
  378. X! # ifndef MSDOS
  379. X!         lprintf(",  time per move: %d ms",(long)((logg.cputime*1000)/logg.moves));
  380. X! # endif
  381. X!         lprintf("\n");
  382. X  #endif
  383. X          }
  384. X          lflush();  lrclose();  return;
  385. X
  386. END_OF_FILE
  387. if test 11173 -ne `wc -c <'patches01'`; then
  388.     echo shar: \"'patches01'\" unpacked with wrong size!
  389. fi
  390. # end of 'patches01'
  391. fi
  392. echo shar: End of shell archive.
  393. exit 0
  394.