summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2005-03-10 23:36:38 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2005-03-10 23:36:38 +0000
commit95683b8ecea0b12342b259e501e7eed8b5c40ee6 (patch)
tree4ffb745956f8911de066ffa4b88b5265b10ee845
parentdbd66d7d64361e76e3e366d919001a5b7ecd77c9 (diff)
downloadmana-95683b8ecea0b12342b259e501e7eed8b5c40ee6.tar.gz
mana-95683b8ecea0b12342b259e501e7eed8b5c40ee6.tar.bz2
mana-95683b8ecea0b12342b259e501e7eed8b5c40ee6.tar.xz
mana-95683b8ecea0b12342b259e501e7eed8b5c40ee6.zip
This should make mouse walking work.
-rw-r--r--src/being.cpp3
-rw-r--r--src/engine.cpp6
-rw-r--r--src/game.cpp5
3 files changed, 8 insertions, 6 deletions
diff --git a/src/being.cpp b/src/being.cpp
index c3add140..f49e7145 100644
--- a/src/being.cpp
+++ b/src/being.cpp
@@ -211,6 +211,9 @@ void Being::nextStep()
y = path->y;
} else {
action = STAND;
+ if (this == player_node) {
+ walk_status = 0;
+ }
}
frame = 0;
walk_time = tick_time;
diff --git a/src/engine.cpp b/src/engine.cpp
index ecf75750..8ba4e7ea 100644
--- a/src/engine.cpp
+++ b/src/engine.cpp
@@ -379,11 +379,7 @@ void Engine::draw()
(get_elapsed_time(being->walk_time) * 4) / (being->speed);
if (being->frame >= 4) {
- being->frame = 0;
- being->action = STAND;
- if (being->id == player_node->id) {
- walk_status = 0;
- }
+ being->nextStep();
}
}
}
diff --git a/src/game.cpp b/src/game.cpp
index cb6d3615..81c07375 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -353,8 +353,11 @@ void do_input()
}
else if (event.button.button == 1)
{
- // Experimental mouse walk command
+ // Experimental mouse walk support
walk(mx, my, 0);
+ player_node->setPath(tiledMap->findPath(
+ player_node->x, player_node->y,
+ mx, my));
}
}