[comp.sources.games.bugs] omega file restore bug

mikep@ism780c.UUCP (Michael A. Petonic) (01/27/88)

In article <1956@bsu-cs.UUCP> cmness@bsu-cs.UUCP (Christopher Ness) writes:
>I also have noted that the game, when finding a copied file, fails
>to recognize me as the wizard.  It goes into an auto enter game-starvation
>mode.  Any hints?


Yeah - a very pragmatic one (aside from not playing omega...).
Edit the file olev.c and at the function "gameidcheck()" starting
at line 282, insert the statment "return(TRUE);" as the first
executable statement.  This should be line #288.

Caveats:  Of course, this means that you can copy the files without
worrying about having used the save game before (which is in bad
form).

-MikeP

ajcd@its63b.ed.ac.uk (Angus Duggan, Department of Computer Science, University of Edinburgh,) (01/28/88)

[Warning: line eater at work ...]

I've just compiled omega, and have been caught by some bugs. Here are fixes
for the couple I've found.

#1 Wizard unable to restore games - this is caused by the function
gameidcheck() exiting without specifying a return() value. This is fixed by
swapping a couple of lines over (I'm not sure if I got the context diffs the
right way round, so check this against your source) -

*** olev.c	Wed Jan 27 16:10:56 1988
--- olev.c~	Mon Jan 25 14:49:16 1988
***************
*** 298,303
        fd = fopen(Str2,"a");
        for(i=0;i<2-found;i++)
  	write_int(fd,gameid);
!     }
!     return((found<2) || (strcmp(getlogin(),WIZARD)==0));
    }

--- 298,304 -----
        fd = fopen(Str2,"a");
        for(i=0;i<2-found;i++)
  	write_int(fd,gameid);
!       return((found<2) || (strcmp(getlogin(),WIZARD)==0));
!      }
    }
    else {


#2 This bug causes a segmentation violation if you kill the last monster
in the monster list (yet another variation on dereferencing the NULL pointer).
It may also cause monsters to miss their turn to attack.

*** otime.c	Wed Jan 27 16:48:06 1988
--- otime.c~	Mon Jan 25 14:49:20 1988
***************
*** 59,71
        free((char *) tempml->m);
        free((char *) tempml);
      }
!     else {
!       if (Tick == ml->m->click) {
! 	ml->m->click = (ml->m->click + ml->m->speed) % 50;
! 	m_pulse(ml->m);
!       }
!       prevml = ml;
!       ml = ml->next;
      }
    }
  }

--- 59,67 -----
        free((char *) tempml->m);
        free((char *) tempml);
      }
!     else if (Tick == ml->m->click) {
!       ml->m->click = (ml->m->click + ml->m->speed) % 50;
!       m_pulse(ml->m);
      }
      prevml = ml;
      ml = ml->next;
  

I've also run across monsters and money on top of wall spaces, and monsters
which can be walked through (usually fnords). Any fixes for these would be
appreciated.

-- 
Angus Duggan, Department of Computer Science, University of Edinburgh,
James Clerk Maxwell Building, The King's Buildings, Mayfield Road,
Edinburgh, EH9 3JZ, Scotland, U.K.
JANET:  ajcd@uk.ac.ed.ecsvax  ARPA: ajcd%ed.ecsvax@nss.cs.ucl.ac.uk
USENET: ajcd@ecsvax.ed.ac.uk  UUCP: ...!mcvax!ukc!ed.ecsvax!ajcd
BITNET: ukacrl.earn!ed.ecsvax!ajcd or ajcd%ed.ecsvax@uk.ac