Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!mnetor!seismo!rutgers!sri-unix!hplabs!decwrl!pyramid!oliveb!intelca!mipos3!omepd!psu-cs!reed!tektronix!teklds!zeus!tims
From: tims@zeus.UUCP (Tim Stoehr)
Newsgroups: net.sources.games
Subject: Bug in rogue 5.3 clone source.
Message-ID: <1018@zeus.UUCP>
Date: Fri, 19-Dec-86 20:27:22 EST
Article-I.D.: zeus.1018
Posted: Fri Dec 19 20:27:22 1986
Date-Received: Tue, 23-Dec-86 21:39:37 EST
Distribution: na
Organization: Tektronix Inc., Beaverton, Or.
Lines: 48


I was informed on the phone today of a pointer bug, and another potential
bug, in my rogue source.


In monster.c, in the routine aggravate(), there is the following while loop:

	while (monster) {
		wake_up(monster);
		monster->m_flags &= (~IMITATES);
		if (rogue_can_see(monster->row, monster->col)) {
			mvaddch(monster->row, monster->col, monster->m_char);
		}
		monster = monster->next_monster;
	}

Make sure that the the line "monster = monster->next_monster" is placed
as in the above.  If I'd been smart enough to use -1 instead of 0
for nil pointers, I would have found this long ago.

In random.c in the routine get_rand(), there is something like:

	if (x > y) {
		t = y;
		y = x;
		x = t;
	}

In the distribution, it was slightly different, it should read as above.
This code may never be executed, but it should be fixed nevertheless.


The person who pointed out these to me also believed there was an
unnecessary break statement at line 185 in throw.c:

	while ((i < 9) && dungeon[row][col] & ~(FLOOR | TUNNEL | DOOR | MONSTER)) {
		rand_around(i++, &row, &col);
		if ((row > (DROWS-2)) || (row < MIN_ROW) ||
			(col > (DCOLS-1)) || (col < 0) || (!dungeon[row][col]) ||
			(dungeon[row][col] & ~(FLOOR | TUNNEL | DOOR | MONSTER))) {
			continue;
		}
		found = 1;
		break;
	}

To the best of my knowledge, the break statement is functional and correct.
Don't remove it.