[comp.sources.games.bugs] Omega2 - 3 bugfixes

pcolby@robbie.prime.com (Peter Colby) (11/17/88)

This patch contains 3 bugfixes to omega2.

	1) If you have been stripped of your rank in the Order because of an
	   alignment shift to chaos, you are no longer allowed into the
	   Order building as a minion of chaos. This is consistant with
	   treatment by the various Lawful Deities.
	2) Casting an area effect spell (fireball, snowball, etc.) at the
	   edge of the map would cause a segment violation (on a Sun).
	3) Entering too many Houses, Hovels, or Mansions would eventually
	   cause a segment violation (on a Sun) due to running out of file
	   descriptors.

To apply the patches just cd to the directory containing your sources
to Omega2 and run this article through patch.

X=========X=========X=========X cut here X=========X=========X=========X

*** oguild2.c.orig	Fri Sep 23 15:48:53 1988
--- oguild2.c	Thu Oct 20 14:44:57 1988
***************
*** 6,11 ****
--- 6,14 ----
  /* They are all l_ functions since they are basically activated*/
  /* at some site or other. */
  
+ /* 20-oct-88 Peter Colby - fix so that members of the ORDER who have */
+ /*                         become chaotic are stripped of their rank */
+ 
  #include "oglob.h"
  
  
***************
*** 625,631 ****
      Player.maxpow += 10;
      Player.pow += 10;
    }
!   if ((Player.rank[ORDER] == -1) || (Player.alignment < 1)) 
      print1("Get thee hence, minion of chaos!");
    else if (Player.rank[ORDER] == 0) {
      if (Player.rank[ARENA] != 0) 
--- 628,635 ----
      Player.maxpow += 10;
      Player.pow += 10;
    }
!   if ((Player.rank[ORDER] == -1) ||
!     ((Player.rank[ORDER] == 0) && (Player.alignment < 1)))
      print1("Get thee hence, minion of chaos!");
    else if (Player.rank[ORDER] == 0) {
      if (Player.rank[ARENA] != 0) 
*** ohouse.c.orig	Wed Nov 16 12:56:02 1988
--- ohouse.c	Wed Nov 16 13:09:59 1988
***************
*** 2,7 ****
--- 2,9 ----
  /* ovillage.c */
  /* some functions to make the house levels */
  
+ /* 16-nov-88 Peter Colby - close the house file opened in load_house */
+ 
  #include "oglob.h"
  
  
***************
*** 154,159 ****
--- 156,162 ----
      }
      fscanf(fd,"\n");
    }
+   (void) fclose(fd);
  }
  
  
*** oscr.c.orig	Thu Oct 13 14:38:58 1988
--- ../../oscr.c	Wed Nov 16 13:43:20 1988
***************
*** 4,9 ****
--- 4,11 ----
  /* plus a few file i/o stuff */
  /* also some in ofile.c */
  
+ /* 13-oct-88 Peter Colby - always check inbounds(x,y) when Level->site[x][y] */
+ 
  #include <curses.h>
  #include <sys/types.h>
  #include <sys/timeb.h>
***************
*** 389,394 ****
--- 391,397 ----
  int litroom(x,y)
  int x,y;
  {
+   if (!inbounds(x,y)) return(FALSE);
    if (Level->site[x][y].roomnumber < ROOMBASE) return(FALSE);
    else return(loc_statusp(x,y,LIT) ||
  	      Player.status[ILLUMINATION]);
***************
*** 460,472 ****
  void drawspot(x,y)
  int x,y;
  {
!   char c = getspot(x,y,FALSE);
!   if (c != Level->site[x][y].showchar)
!     if (view_los_p(Player.x,Player.y,x,y)) {
!       lset(x,y,SEEN);
!       Level->site[x][y].showchar = c;
!       putspot(x,y,c);
!     }
  }
  
  
--- 463,477 ----
  void drawspot(x,y)
  int x,y;
  {
!   if (inbounds(x,y)) {
!     char c = getspot(x,y,FALSE);
!     if (c != Level->site[x][y].showchar)
!       if (view_los_p(Player.x,Player.y,x,y)) {
!         lset(x,y,SEEN);
!         Level->site[x][y].showchar = c;
!         putspot(x,y,c);
!       }
!   }
  }
  
  
***************
*** 475,485 ****
  void dodrawspot(x,y)
  int x,y;
  {
!   char c = getspot(x,y,FALSE);
!   if (c != Level->site[x][y].showchar) {
!     lset(x,y,SEEN);
!     Level->site[x][y].showchar = c;
!     putspot(x,y,c);
    }
  }
  
--- 480,492 ----
  void dodrawspot(x,y)
  int x,y;
  {
!   if (inbounds(x,y)) {
!     char c = getspot(x,y,FALSE);
!     if (c != Level->site[x][y].showchar) {
!       lset(x,y,SEEN);
!       Level->site[x][y].showchar = c;
!       putspot(x,y,c);
!     }
    }
  }
  
***************
*** 487,496 ****
  void blankoutspot(i,j)
  int i,j;
  {
!   lreset(i,j,LIT);
!   if (Level->site[i][j].locchar == FLOOR)  {
!     Level->site[i][j].showchar = ' ';
!     putspot(i,j,' ');
    }
  }
  
--- 494,505 ----
  void blankoutspot(i,j)
  int i,j;
  {
!   if (inbounds(i,j)) {
!     lreset(i,j,LIT);
!     if (Level->site[i][j].locchar == FLOOR)  {
!       Level->site[i][j].showchar = ' ';
!       putspot(i,j,' ');
!     }
    }
  }
  
***************
*** 498,509 ****
  void blotspot(i,j)
  int i,j;
  {
!   lreset(i,j,SEEN);
!   Level->site[i][j].showchar = SPACE;
!   if (! offscreen(j)) {
!     wmove(Levelw,screenmod(j),i);
!     wdelch(Levelw);
!     winsch(Levelw,SPACE);
    }
  }
  
--- 507,520 ----
  void blotspot(i,j)
  int i,j;
  {
!   if (inbounds(i,j)) {
!     lreset(i,j,SEEN);
!     Level->site[i][j].showchar = SPACE;
!     if (! offscreen(j)) {
!       wmove(Levelw,screenmod(j),i);
!       wdelch(Levelw);
!       winsch(Levelw,SPACE);
!     }
    }
  }
  
***************
*** 577,582 ****
--- 588,594 ----
  char getspot(x,y,showmonster)
  int x,y,showmonster;
  {
+   if (!inbounds(x,y)) return(' ');
    if (loc_statusp(x,y,SECRET)) return(WALL);
    else switch (Level->site[x][y].locchar) {
    case WATER:
***************
*** 1205,1215 ****
  int x,y;
  { 
    char c;
!   lset(x,y,LIT);
!   lset(x,y,SEEN);
!   c = getspot(x,y,FALSE);
!   Level->site[x][y].showchar = c;
!   putspot(x,y,c);
  }
  
  
--- 1217,1230 ----
  int x,y;
  { 
    char c;
! 
!   if (inbounds(x,y)) {
!     lset(x,y,LIT);
!     lset(x,y,SEEN);
!     c = getspot(x,y,FALSE);
!     Level->site[x][y].showchar = c;
!     putspot(x,y,c);
!   }
  }
  
  
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
UUCP: {sun,decvax,linus}!cvbnet!pcolby ||| "We has met the enemy and he is us."
UUCP: pcolby@robbie.prime.com          |||                           Pogo
CSNET: pcolby@robbie.prime.com         |||