From 0bca1b9756a93d876cbf4a411b47634b87775162 Mon Sep 17 00:00:00 2001 From: Roderic Morris Date: Wed, 1 Jul 2009 20:39:28 -0400 Subject: Remove complex path finding for players. Add a simple path finding algorithm to map. --- src/player.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/player.cpp') diff --git a/src/player.cpp b/src/player.cpp index 520342e3..597fb14b 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -149,6 +149,20 @@ void Player::logic() } #endif +Path Player::findPath() +{ + Path path; + + if (mMap) + { + path = mMap->findSimplePath(getPosition().x / 32, getPosition().y / 32, + getDestination().x / 32, getDestination().y / 32, + getWalkMask()); + } + + return path; +} + Being::Type Player::getType() const { return PLAYER; -- cgit v1.2.3-60-g2f50