• Global announcement
    Replies
    Views
    Last post

r7164 | bug in Misc::calcRectArea

This place is for INTELLIGENT bug reports only. NOT for asking help!

Moderators: Moderators, Sub-Moderators

r7164 | bug in Misc::calcRectArea

Postby allanon256 » 06 Mar 2010, 19:49

I noticed that runFromTarget was failing to run properly in some circumstances, and found that there is a bug in Misc::calcRectArea. Specifically, the code is checking for non-walkable tiles on the left side when it is supposed to be checking the right side.

I've fixed the issue for myself, and figured others might benefit from the fix as well. Here is a patch to fix the issue:

Code: Select all
--- src/Misc.pm (revision 7164)
+++ src/Misc.pm (working copy)
@@ -511,7 +511,7 @@
                }
        }
        for (my $y = $bottomRight{y} + 1; $y < $topRight{y}; $y++) {
-               if ($field->isWalkable($topLeft{x}, $y)) {
+               if ($field->isWalkable($topRight{x}, $y)) {
                        push @walkableBlocks, {x => $topRight{x}, y => $y};
                }
        }
allanon256
Noob
Noob
 
Posts: 1
Joined: 06 Mar 2010, 19:33

Re: r7164 | bug in Misc::calcRectArea

Postby Technology » 11 Mar 2010, 09:26

thanks allanon256,
its in svn now
Nil volentibus arduum.
"Nothing is impossible for those who want."
User avatar
Technology
Developers
Developers
 
Posts: 929
Joined: 06 May 2008, 12:47

Re: r7164 | bug in Misc::calcRectArea

Postby kali » 11 Mar 2010, 11:01

Wow thanks, good catch! :)
Visit my blog.

Got your topic trashed by a mod?

Trashing topics is one click, and moving a topic to its proper forum is a lot harder. You expend the least effort in deciding where to post, mods expend the least effort by trashing.

Have a nice day.
kali
OpenKore Monk
OpenKore Monk
 
Posts: 452
Joined: 04 Apr 2008, 10:10


Return to Bug reports

Who is online

Users browsing this forum: No registered users and 1 guest