summaryrefslogtreecommitdiff
path: root/src/map.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2007-09-20 13:24:20 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2007-09-20 13:24:20 +0000
commita84133850af6d348c0c4e252b26618148702153b (patch)
treef4b8d7c9bbdeecd9c1976bdc3d3806909a25cd28 /src/map.cpp
parent1afcf2608c0a466d2df21faea1530955cc8061fc (diff)
downloadmana-client-a84133850af6d348c0c4e252b26618148702153b.tar.gz
mana-client-a84133850af6d348c0c4e252b26618148702153b.tar.bz2
mana-client-a84133850af6d348c0c4e252b26618148702153b.tar.xz
mana-client-a84133850af6d348c0c4e252b26618148702153b.zip
Merged a bunch of small changes from trunk to 0.0 and set svn:eol-style
to native for some files that were still missing this property. This is a feeble attempt to reduce the amount of conflicts for future merges.
Diffstat (limited to 'src/map.cpp')
-rw-r--r--src/map.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/map.cpp b/src/map.cpp
index 1f0c22b9..1ee2248f 100644
--- a/src/map.cpp
+++ b/src/map.cpp
@@ -148,8 +148,8 @@ Map::draw(Graphics *graphics, int scrollX, int scrollY, int layer)
if (startX < 0) startX = 0;
if (startY < 0) startY = 0;
- if (endX >= mWidth) endX = mWidth;
- if (endY >= mHeight) endY = mHeight;
+ if (endX > mWidth) endX = mWidth;
+ if (endY > mHeight) endY = mHeight;
for (int y = startY; y < endY; y++)
{
@@ -281,13 +281,13 @@ Map::setWalk(int x, int y, bool walkable)
}
bool
-Map::getWalk(int x, int y)
+Map::getWalk(int x, int y) const
{
return !tileCollides(x, y) && !occupied(x, y);
}
bool
-Map::occupied(int x, int y)
+Map::occupied(int x, int y) const
{
Beings &beings = beingManager->getAll();
for (BeingIterator i = beings.begin(); i != beings.end(); i++)
@@ -303,13 +303,13 @@ Map::occupied(int x, int y)
}
bool
-Map::tileCollides(int x, int y)
+Map::tileCollides(int x, int y) const
{
return !(contains(x, y) && mMetaTiles[x + y * mWidth].walkable);
}
bool
-Map::contains(int x, int y)
+Map::contains(int x, int y) const
{
return x >= 0 && y >= 0 && x < mWidth && y < mHeight;
}