summaryrefslogtreecommitdiff
path: root/src/map.h
diff options
context:
space:
mode:
authorBertram <bertram@cegetel.net>2010-03-02 23:20:50 +0100
committerBertram <yohanndotferreiraatorange.fr>2010-04-12 23:50:21 +0200
commitdd2b559ea0d467db7fec522a63a66a82c1415b36 (patch)
tree06925dcb5d47d631a1425e4ced8ec1cf8975f88b /src/map.h
parent98967ec85b48fcc85d1468b7fa02b847389431fb (diff)
downloadmana-client-dd2b559ea0d467db7fec522a63a66a82c1415b36.tar.gz
mana-client-dd2b559ea0d467db7fec522a63a66a82c1415b36.tar.bz2
mana-client-dd2b559ea0d467db7fec522a63a66a82c1415b36.tar.xz
mana-client-dd2b559ea0d467db7fec522a63a66a82c1415b36.zip
Move path finding related code to the Map class and small fixes.
It permits two things: 1. It simplifies and demystifies Being::SetDestination() code. 2. It will permit to show the *real* calulated path when using the drawDebugPath feature for ManaServ.
Diffstat (limited to 'src/map.h')
-rw-r--r--src/map.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/map.h b/src/map.h
index 7b91b6bb..0832df93 100644
--- a/src/map.h
+++ b/src/map.h
@@ -272,6 +272,23 @@ class Map : public Properties
const std::string *getFilename() const;
/**
+ * Check the current position against surrounding blocking tiles, and
+ * correct the position offset within tile when needed.
+ */
+ Position checkNodeOffsets(int radius, unsigned char walkMask,
+ const Position &position) const;
+ Position checkNodeOffsets(int radius, unsigned char walkMask,
+ int x, int y) const
+ { return checkNodeOffsets(radius, walkMask, Position(x, y)); }
+
+ /**
+ * Find a pixel path from one location to the next.
+ */
+ Path findPixelPath(int startPixelX, int startPixelY,
+ int destPixelX, int destPixelY,
+ int radius, unsigned char walkmask, int maxCost = 20);
+
+ /**
* Find a path from one location to the next.
*/
Path findPath(int startX, int startY, int destX, int destY,