Aphs.243 net.games.pacman utzoo!decvax!duke!phs!dennis Sun Feb 21 16:59:31 1982 pacman magic passage bug fixed There's a bug in the distributed pacman which allows the monsters to get one free move as they go through the magic passage. This caused me great pain until I fixed it, as I often get chased through there. The fixes are as follows. Add to pacdefs.h: #define xleft(x) ((x)+LEFTINT>=0?(x)+LEFTINT:XWRAP) #define xright(x) ((x)+RIGHTINT<=XWRAP?(x)+RIGHTINT:0) Then, make these changes to monster.c: 108c108 < newx = tmpx + LEFTINT; --- > newx = xleft(tmpx); 110,111d109 < if (newx <= 0) < newx = XWRAP; /* wrap around */ 115c113 < newx = tmpx + RIGHTINT; --- > newx = xright(tmpx); 117,118d114 < if (newx >= XWRAP) < newx = 0; /* wrap around */ 119a116,118 > default: > errgen("bad which"); > break; 184d182 < char *brdptr; 192d189 < brdptr = &(brd[y][x]); 194c191 < ((next = *(brdptr + (BRDX * UPINT))) != WALL) && --- > ((next = brd[y+UPINT][x]) != WALL) && 200c197 < ((next = *(brdptr + (BRDX * DOWNINT))) != WALL) && --- > ((next = brd[y+DOWNINT][x]) != WALL) && 206c203 < ((next = *(brdptr + LEFTINT)) != WALL) && --- > ((next = brd[y][xleft(x)]) != WALL) && 212c209 < ((next = *(brdptr + RIGHTINT)) != WALL) && --- > ((next = brd[y][xright(x)]) != WALL) && 234,235c231,232 < if ((*(brdptr + (BRDX * DOWNINT)) != WALL) && < (*(brdptr + (BRDX * DOWNINT)) != GATE)) --- > if (((next = brd[y+DOWNINT][x]) != WALL) && > (next != GATE)) 242,243c239,240 < if ((*(brdptr + (BRDX * UPINT)) != WALL) && < (*(brdptr + (BRDX * UPINT)) != GATE)) --- > if (((next = brd[y+UPINT][x]) != WALL) && > (next != GATE)) 250,251c247,248 < if ((*(brdptr + LEFTINT) != WALL) && < (*(brdptr + LEFTINT) != GATE)) --- > if ((next = brd[y][xleft(x)]) != WALL && > (next != GATE)) 258,259c255,256 < if ((*(brdptr + RIGHTINT) != WALL) && < (*(brdptr + RIGHTINT) != GATE)) --- > if ((next = brd[y][xright(x)]) != WALL && > (next != GATE))