From 7d0774d9432e4e739b3e94b0cb1c3ceda37d9127 Mon Sep 17 00:00:00 2001 From: dshaligram Date: Sat, 3 Nov 2007 15:26:32 +0000 Subject: Trunk->0.3 merge (2732): Fixed show_beam crash. Also fixed buggy targeting when using show_beam = yes, default_target = no, and hitting ff to fire at a previously selected target. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.3@2733 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/direct.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/crawl-ref/source/direct.cc b/crawl-ref/source/direct.cc index 24c6939f11..9e42a92e8d 100644 --- a/crawl-ref/source/direct.cc +++ b/crawl-ref/source/direct.cc @@ -287,6 +287,8 @@ void direction(dist& moves, targeting_type restricts, moves.dx = moves.dy = 0; moves.tx = you.x_pos; moves.ty = you.y_pos; + if ( show_beam ) + find_ray(you.x_pos, you.y_pos, moves.tx, moves.ty, true, ray); bool skip_iter = false; bool found_autotarget = false; @@ -667,7 +669,8 @@ void direction(dist& moves, targeting_type restricts, } else if ( moves.isTarget && !see_grid(moves.tx, moves.ty) ) { - mpr("Sorry, you can't target what you can't see.", MSGCH_EXAMINE_FILTER); + mpr("Sorry, you can't target what you can't see.", + MSGCH_EXAMINE_FILTER); } // Ask for confirmation if we're quitting for some odd reason else if ( moves.isValid || moves.isCancel || @@ -675,8 +678,7 @@ void direction(dist& moves, targeting_type restricts, { // Finalize whatever is inside the loop // (moves-internal finalizations can be done later) - moves.choseRay = show_beam; - moves.ray = ray; + moves.choseRay = false; break; } } -- cgit v1.2.3-54-g00ecf