r7164 | bug in Misc::calcRectArea

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

Moderators: Moderators, Developers

allanon256
Developers
Developers
Posts: 19
Joined: 06 Mar 2010, 19:33
Noob?: No

r7164 | bug in Misc::calcRectArea

#1 Post by allanon256 »

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};
                }
        }
Technology
Super Moderators
Super Moderators
Posts: 801
Joined: 06 May 2008, 12:47
Noob?: No

Re: r7164 | bug in Misc::calcRectArea

#2 Post by Technology »

thanks allanon256,
its in svn now
One ST0 to rule them all? One PE viewer to find them!
One ST_kRO to bring them all and in the darkness bind them...

Mount Doom awaits us, fellowship of OpenKore!
kali
OpenKore Monk
OpenKore Monk
Posts: 457
Joined: 04 Apr 2008, 10:10

Re: r7164 | bug in Misc::calcRectArea

#3 Post by kali »

Wow thanks, good catch! :)
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.