From 95683b8ecea0b12342b259e501e7eed8b5c40ee6 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Thu, 10 Mar 2005 23:36:38 +0000 Subject: This should make mouse walking work. --- src/being.cpp | 3 +++ src/engine.cpp | 6 +----- src/game.cpp | 5 ++++- 3 files changed, 8 insertions(+), 6 deletions(-) (limited to 'src') 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)); } } -- cgit v1.2.3-70-g09d2