diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-11-03 15:26:32 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-11-03 15:26:32 +0000 |
commit | 7d0774d9432e4e739b3e94b0cb1c3ceda37d9127 (patch) | |
tree | 8732cd5e8a21e4e43d618dc61e089b54f9c439c8 | |
parent | b08679f74745657d1c2a2989a54ab7641a959a97 (diff) | |
download | crawl-ref-7d0774d9432e4e739b3e94b0cb1c3ceda37d9127.tar.gz crawl-ref-7d0774d9432e4e739b3e94b0cb1c3ceda37d9127.zip |
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
-rw-r--r-- | crawl-ref/source/direct.cc | 8 |
1 files 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; } } |