From b42bd161b6822443312c2fd75dc1d724edd30e13 Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Thu, 29 May 2008 09:44:50 +0000 Subject: Modify tutorial messages for the new triggers. Thanks again, Matthew! :) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5328 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/travel.cc | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'crawl-ref/source/travel.cc') diff --git a/crawl-ref/source/travel.cc b/crawl-ref/source/travel.cc index 50ad0e67a7..3b5a0f36ba 100644 --- a/crawl-ref/source/travel.cc +++ b/crawl-ref/source/travel.cc @@ -1585,7 +1585,15 @@ bool travel_pathfind::path_flood(const coord_def &c, const coord_def &dc) return (true); } - if (dc != dest && !is_travelsafe_square(dc.x, dc.y, ignore_hostile)) + if (dc == dest) + { + // Hallelujah, we're home! + if (_is_safe_move(c.x, c.y)) + next_travel_move = c; + + return (true); + } + else if (!is_travelsafe_square(dc.x, dc.y, ignore_hostile)) { // This point is not okay to travel on, but if this is a // trap, we'll want to put it on the feature vector anyway. @@ -1609,14 +1617,7 @@ bool travel_pathfind::path_flood(const coord_def &c, const coord_def &dc) return (false); } - if (dc == dest) - { - // Hallelujah, we're home! - if (_is_safe_move(c.x, c.y)) - next_travel_move = c; - return (true); - } - else if (!point_distance[dc.x][dc.y]) + if (!point_distance[dc.x][dc.y]) { // This point is going to be on the agenda for the next // iteration -- cgit v1.2.3-54-g00ecf