getObs() bug
Displaying 1-2 of 2 total.
Please enter a numerical value for the importance of this sticky.
Enter 0 to unsticky.

I found a bug in getObs() that returns invalid results on maps that are much taller then they are wide, and the x/y checked for is beyond the width.

I made a fix in my working copy, and made a test case to check for it (wee!)

From what I've found the bug is in g_map.cpp:line 431 int MAP::obstruct(int x, int y)

The line that says
if (x<0 || y<0 || x>=mapwidth || y>=mapwidth) return 1;
should be
if (x<0 || y<0 || x>=mapwidth || y>=mapheight) return 1;

Posted on 2008-02-11 21:43:55


Thanks! You just made revision 201!

You rock.

Posted on 2008-02-13 00:20:05

Displaying 1-2 of 2 total.
Newest messages

Ben McGraw's lovingly crafted this website from scratch for years.
It's a lot prettier this go around because of Jon Wofford. is a member of the lunarnet irc network, and would like to take this opportunity to remind you that regardless how babies taste, it is wrong to eat them.