diff options
author | Vladimir Menshakov | 2009-12-07 22:11:45 +0000 |
---|---|---|
committer | Vladimir Menshakov | 2009-12-07 22:11:45 +0000 |
commit | fce6502bd8de5233c38675b0108737e834813622 (patch) | |
tree | e371e75d82d702540f3800fa7cb7dbbdbf39330b /engines | |
parent | 2e4a257e45031b79b2931e38d56d7c09ea4286fd (diff) | |
download | scummvm-rg350-fce6502bd8de5233c38675b0108737e834813622.tar.gz scummvm-rg350-fce6502bd8de5233c38675b0108737e834813622.tar.bz2 scummvm-rg350-fce6502bd8de5233c38675b0108737e834813622.zip |
finally fixed pathfinding
svn-id: r46287
Diffstat (limited to 'engines')
-rw-r--r-- | engines/teenagent/objects.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/engines/teenagent/objects.h b/engines/teenagent/objects.h index 19978a01cf..bab3830005 100644 --- a/engines/teenagent/objects.h +++ b/engines/teenagent/objects.h @@ -94,12 +94,12 @@ struct Rect { if (dx != 0) { int yl = (left - a.x) * dy / dx + a.y; - if (yl > top && yl < bottom && inside(yl, a.y, b.y)) { + if (yl > top && yl < bottom && inside(yl, a.y, b.y) && inside(left, a.x, b.x)) { //c[idx++] = Common::Point(left, yl); mask |= 8; } int yr = (right - a.x) * dy / dx + a.y; - if (yr > top && yr < bottom && inside(yr, a.y, b.y)) { + if (yr > top && yr < bottom && inside(yr, a.y, b.y) && inside(right, a.x, b.x)) { //c[idx++] = Common::Point(right, yr); mask |= 2; } @@ -107,13 +107,13 @@ struct Rect { if (dy != 0) { int xt = (top - a.y) * dx / dy + a.x; - if (xt > left && xt < right && inside(xt, a.x, b.x)) { + if (xt > left && xt < right && inside(xt, a.x, b.x) && inside(top, a.y, b.y)) { //assert(idx < 2); //c[idx++] = Common::Point(xt, top); mask |= 1; } int xb = (bottom - a.y) * dx / dy + a.x; - if (xb > left && xb < right && inside(xb, a.x, b.x)) { + if (xb > left && xb < right && inside(xb, a.x, b.x) && inside(bottom, a.y, b.y)) { //assert(idx < 2); //c[idx++] = Common::Point(xb, bottom); mask |= 4; |