diff options
author | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-07-08 01:00:51 +0000 |
---|---|---|
committer | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-07-08 01:00:51 +0000 |
commit | b49b73d9b3736c7dad367e7f61c78ca35787f428 (patch) | |
tree | 90b20c0aa3aef6ca3f37a367c6009221b0b14e25 /crawl-ref/source/direct.cc | |
parent | 7fd9d9a617f65db7695d4858deed6f2cc01fd72c (diff) | |
download | crawl-ref-b49b73d9b3736c7dad367e7f61c78ca35787f428.tar.gz crawl-ref-b49b73d9b3736c7dad367e7f61c78ca35787f428.zip |
Lots and lots of type safety.
Caught a bug in the definition of shadows (isn't it lucky that
BLACK == MST_NO_SPELLS?)
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1788 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/direct.cc')
-rw-r--r-- | crawl-ref/source/direct.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/crawl-ref/source/direct.cc b/crawl-ref/source/direct.cc index f8cef123fe..49ac7db165 100644 --- a/crawl-ref/source/direct.cc +++ b/crawl-ref/source/direct.cc @@ -308,7 +308,7 @@ static void draw_ray_glyph(const coord_def &pos, int colour, // //--------------------------------------------------------------- void direction(dist& moves, targeting_type restricts, - int mode, bool just_looking, const char *prompt) + targ_mode_type mode, bool just_looking, const char *prompt) { // NOTE: Even if just_looking is set, moves is still interesting, // because we can travel there! @@ -524,7 +524,7 @@ void direction(dist& moves, targeting_type restricts, break; case CMD_TARGET_CYCLE_TARGET_MODE: - mode = (mode + 1) % TARG_NUM_MODES; + mode = static_cast<targ_mode_type>((mode + 1) % TARG_NUM_MODES); mprf( "Targeting mode is now: %s", (mode == TARG_ANY) ? "any" : (mode == TARG_ENEMY) ? "enemies" : @@ -657,6 +657,7 @@ void direction(dist& moves, targeting_type restricts, // A bunch of confirmation tests; if we survive them all, // then break out. + // Confirm self-targeting on TARG_ENEMY. // Conceivably we might want to confirm on TARG_ANY too. if ( moves.isTarget && moves.tx == you.x_pos && moves.ty == you.y_pos && @@ -672,7 +673,7 @@ void direction(dist& moves, targeting_type restricts, } // Ask for confirmation if we're quitting for some odd reason else if ( moves.isValid || moves.isCancel || - yesno("Are you sure you want to fizzle?") ) + yesno("Are you sure you want to fizzle?") ) { // Finalize whatever is inside the loop // (moves-internal finalizations can be done later) |