summaryrefslogtreecommitdiff
path: root/src/map.cpp
diff options
context:
space:
mode:
authorGuillaume Melquiond <guillaume.melquiond@gmail.com>2006-08-06 17:30:40 +0000
committerGuillaume Melquiond <guillaume.melquiond@gmail.com>2006-08-06 17:30:40 +0000
commit4c15d1d1dcedb3627e501fb5ddba4ae74281968c (patch)
treede4a44e603d05742b4eaffff75b759e1ac6ff85c /src/map.cpp
parentce849af300a70425b574b724c62dc9f5fce6016b (diff)
downloadmanaserv-4c15d1d1dcedb3627e501fb5ddba4ae74281968c.tar.gz
manaserv-4c15d1d1dcedb3627e501fb5ddba4ae74281968c.tar.bz2
manaserv-4c15d1d1dcedb3627e501fb5ddba4ae74281968c.tar.xz
manaserv-4c15d1d1dcedb3627e501fb5ddba4ae74281968c.zip
Implemented crude handling of being movements.
Diffstat (limited to 'src/map.cpp')
-rw-r--r--src/map.cpp30
1 files changed, 6 insertions, 24 deletions
diff --git a/src/map.cpp b/src/map.cpp
index 89c34ee6..8a768e07 100644
--- a/src/map.cpp
+++ b/src/map.cpp
@@ -123,30 +123,6 @@ Map::getMetaTile(int x, int y)
return &metaTiles[x + y * width];
}
-int
-Map::getWidth()
-{
- return width;
-}
-
-int
-Map::getHeight()
-{
- return height;
-}
-
-int
-Map::getTileWidth()
-{
- return tileWidth;
-}
-
-int
-Map::getTileHeight()
-{
- return tileHeight;
-}
-
std::list<PATH_NODE>
Map::findPath(int startX, int startY, int destX, int destY)
{
@@ -305,3 +281,9 @@ Map::findPath(int startX, int startY, int destX, int destY)
return path;
}
+
+bool areAround(unsigned x1, unsigned y1, unsigned x2, unsigned y2)
+{
+ return (abs(x1 - x2) <= (int)AROUND_AREA &&
+ abs(y1 - y2) <= (int)AROUND_AREA);
+}