Path: utzoo!utgpu!water!watmath!clyde!rutgers!sri-spam!ames!amdcad!sun!pitstop!sundc!seismo!uunet!mcvax!ukc!its63b!ajcd From: ajcd@its63b.ed.ac.uk (Angus Duggan, Department of Computer Science, University of Edinburgh,) Newsgroups: comp.sources.games.bugs Subject: Re: omega file restore bug Summary: Omega bug fixes Keywords: core bug Message-ID: <927@its63b.ed.ac.uk> Date: 28 Jan 88 11:46:44 GMT References: <1466@uhccux.UUCP> <1430@bucsb.UUCP> <1956@bsu-cs.UUCP> <8723@ism780c.UUCP> Reply-To: ajcd@its63b.ed.ac.uk (Angus Duggan) Organization: I.T. School, Univ. of Edinburgh, U.K. Lines: 76 [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