summaryrefslogtreecommitdiff
path: root/src/gui/viewport.cpp
diff options
context:
space:
mode:
authorPhilipp Sehmisch <tmw@crushnet.org>2008-03-13 07:29:30 +0000
committerPhilipp Sehmisch <tmw@crushnet.org>2008-03-13 07:29:30 +0000
commitfe474eb4fae9d89e3797d0ceaae6613798ce491f (patch)
tree2a91b2f17636ae7b20eea06a28a89942f6f36d39 /src/gui/viewport.cpp
parent3a275cc81fe9aa1cb6736cdf12211e13e93cf2cf (diff)
downloadmana-fe474eb4fae9d89e3797d0ceaae6613798ce491f.tar.gz
mana-fe474eb4fae9d89e3797d0ceaae6613798ce491f.tar.bz2
mana-fe474eb4fae9d89e3797d0ceaae6613798ce491f.tar.xz
mana-fe474eb4fae9d89e3797d0ceaae6613798ce491f.zip
Synchronized pathfinding algorithmns with those used by the server to avoid asynchronisation.
Diffstat (limited to 'src/gui/viewport.cpp')
-rw-r--r--src/gui/viewport.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp
index 57c64cd6..d6c49fb2 100644
--- a/src/gui/viewport.cpp
+++ b/src/gui/viewport.cpp
@@ -221,6 +221,10 @@ Viewport::draw(gcn::Graphics *gcnGraphics)
drawTargetCursor(graphics);
mMap->draw(graphics, mCameraX, mCameraY, 1);
mMap->draw(graphics, mCameraX, mCameraY, 2);
+ if (mShowDebugPath)
+ {
+ mMap->drawCollision(graphics, mCameraX, mCameraY);
+ }
mMap->drawOverlay(graphics, mViewX, mViewY,
(int) config.getValue("OverlayDetail", 2));
drawTargetName(graphics);
@@ -335,7 +339,7 @@ Viewport::drawDebugPath(Graphics *graphics)
Path debugPath = mMap->findPath(
player_node->mX / 32, player_node->mY / 32,
- mouseTileX, mouseTileY);
+ mouseTileX, mouseTileY, 0xFF);
graphics->setColor(gcn::Color(255, 0, 0));
for (PathIterator i = debugPath.begin(); i != debugPath.end(); i++)
@@ -399,7 +403,7 @@ Viewport::mousePressed(gcn::MouseEvent &event)
player_node->pickUp(item);
}
// Just walk around
- else if (mMap->getWalk(tilex, tiley))
+ else if (mMap->getWalk(tilex, tiley, player_node->getWalkMask()))
{
// XXX XXX XXX REALLY UGLY!
Uint8 *keys = SDL_GetKeyState(NULL);