wanderer arrow display bug, unofficial patch
Jef Poskanzer
pokey at well.UUCP
Thu Jul 21 18:46:17 AEST 1988
Appended please find a fix to the problem of arrow display in wanderer.
It was an off-by-one error causing the arrows to sometimes not display or
display when they should / shouldn't have. Finding it was a little
hard because the code is full of mystery integers and is formatted
like FORTRAN.
---
Jef
Jef Poskanzer jef at rtsg.ee.lbl.gov ...well!pokey
Flon's Law: There is not now, and never will be, a language in which it is the
least bit difficult to write bad programs.
RCS file: RCS/fall.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -c -r1.1 -r1.2
*** /tmp/,RCSt1a06074 Wed Jul 20 17:47:56 1988
--- /tmp/,RCSt2a06074 Wed Jul 20 17:47:58 1988
***************
*** 117,125 ****
screen[nyr][x] = ' ';
}
screen[nyr][x] = '<';
! if((y<(sy+4)) && (y>(sy-4)) && (x<(sx+6)) && (x>(sx-6)))
draw_symbol((x-sx+6)*3,(y-sy+3)*2,' ');
! if((nyr<(sy+4)) && (nyr>(sy-4)) && (x<(sx+7)) && (x>(sx-5)))
draw_symbol((x-sx+5)*3,(nyr-sy+3)*2,'<');
refresh();
retval+=fall(mx,my,x-1,nyr,sx,sy,screen,howdead);
--- 117,125 ----
screen[nyr][x] = ' ';
}
screen[nyr][x] = '<';
! if((y<(sy+4)) && (y>(sy-4)) && (x<(sx+5)) && (x>(sx-7)))
draw_symbol((x-sx+6)*3,(y-sy+3)*2,' ');
! if((nyr<(sy+4)) && (nyr>(sy-4)) && (x<(sx+6)) && (x>(sx-6)))
draw_symbol((x-sx+5)*3,(nyr-sy+3)*2,'<');
refresh();
retval+=fall(mx,my,x-1,nyr,sx,sy,screen,howdead);
***************
*** 157,165 ****
screen[nyl][x] = ' ';
}
screen[nyl][x] = '>';
! if((y<(sy+4)) && (y>(sy-4)) && (x<(sx+6)) && (x>(sx-6)))
draw_symbol((x-sx+4)*3,(y-sy+3)*2,' ');
! if((nyl<(sy+4)) && (nyl>(sy-4)) && (x<(sx+5)) && (x>(sx-7)))
draw_symbol((x-sx+5)*3,(nyl-sy+3)*2,'>');
refresh();
retval+=fall(mx,my,x+1,nyl,sx,sy,screen,howdead);
--- 157,165 ----
screen[nyl][x] = ' ';
}
screen[nyl][x] = '>';
! if((y<(sy+4)) && (y>(sy-4)) && (x<(sx+7)) && (x>(sx-5)))
draw_symbol((x-sx+4)*3,(y-sy+3)*2,' ');
! if((nyl<(sy+4)) && (nyl>(sy-4)) && (x<(sx+6)) && (x>(sx-6)))
draw_symbol((x-sx+5)*3,(nyl-sy+3)*2,'>');
refresh();
retval+=fall(mx,my,x+1,nyl,sx,sy,screen,howdead);
More information about the Comp.sources.bugs
mailing list