From b49b73d9b3736c7dad367e7f61c78ca35787f428 Mon Sep 17 00:00:00 2001 From: haranp Date: Sun, 8 Jul 2007 01:00:51 +0000 Subject: 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 --- crawl-ref/source/direct.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'crawl-ref/source/direct.cc') 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((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) -- cgit v1.2.3-54-g00ecf