From d459948cef28e17a4008352da97eeb43dd58f93e Mon Sep 17 00:00:00 2001 From: zelgadis Date: Mon, 17 Dec 2007 10:03:47 +0000 Subject: Experimental "improved" explore algorithm which can be turned on by adding "explore_improved=true" to crawlrc. The intent is to reduce backtracking and zig-zagging during auto-explore. Currently only works with non-greedy explore since I can't yet figure out how to intelligently combine it with greediness. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3084 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/player.cc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'crawl-ref/source/player.cc') diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index 2cfa244719..bc36fa055c 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -5271,6 +5271,9 @@ void player::init() x_pos = 0; y_pos = 0; + prev_move_x = 0; + prev_move_y = 0; + running.clear(); travel_x = 0; travel_y = 0; @@ -6227,7 +6230,21 @@ void player::moveto(const coord_def &c) crawl_view.set_player_at(c); if (real_move) + { + you.reset_prev_move(); dungeon_events.fire_position_event(DET_PLAYER_MOVED, c); + } +} + +coord_def player::prev_move() const +{ + return coord_def(prev_move_x, prev_move_y); +} + +void player::reset_prev_move() +{ + prev_move_x = 0; + prev_move_y = 0; } bool player::asleep() const -- cgit v1.2.3-54-g00ecf