summaryrefslogtreecommitdiff
path: root/src/utils/point.h
diff options
context:
space:
mode:
authorYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2011-08-26 00:01:29 +0200
committerYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2011-08-26 00:01:29 +0200
commit054891b516cea1b30a19cc9effb44ecbcf74319d (patch)
tree394155a21f315c360624e4dba9542fbab20303f2 /src/utils/point.h
parentec99e999a918f6680d38704d9408933090d0386a (diff)
downloadmanaserv-054891b516cea1b30a19cc9effb44ecbcf74319d.tar.gz
manaserv-054891b516cea1b30a19cc9effb44ecbcf74319d.tar.bz2
manaserv-054891b516cea1b30a19cc9effb44ecbcf74319d.tar.xz
manaserv-054891b516cea1b30a19cc9effb44ecbcf74319d.zip
Fixed the trigger area declared within map files.
The bug was pretty generic, as the contains() method of the Rectangle class wasn't checking against left and top sides according to the client view point. Resolves: Mana-Mantis #317.
Diffstat (limited to 'src/utils/point.h')
-rw-r--r--src/utils/point.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/utils/point.h b/src/utils/point.h
index 4402aa09..ccd3d2c6 100644
--- a/src/utils/point.h
+++ b/src/utils/point.h
@@ -75,8 +75,8 @@ class Rectangle
bool contains(const Point &p) const
{
- return (p.x - x) < w &&
- (p.y - y) < h;
+ return (p.x >= x && p.x <= x + w &&
+ p.y >= y && p.y <= y + h);
}
bool intersects(const Rectangle &r) const