From 7f57e44d0660cbb1c9971f3c170a011ffa7eb4a1 Mon Sep 17 00:00:00 2001 From: dshaligram Date: Tue, 6 Feb 2007 17:16:29 +0000 Subject: Better messages when canceling butcher. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@925 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/food.cc | 22 ++++++++++++++++------ crawl-ref/source/travel.cc | 6 ++++-- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/crawl-ref/source/food.cc b/crawl-ref/source/food.cc index 0ac4a3801c..a447d19cd6 100644 --- a/crawl-ref/source/food.cc +++ b/crawl-ref/source/food.cc @@ -237,21 +237,26 @@ bool butchery(void) return (false); } - int objl; - - for (objl = igrd[you.x_pos][you.y_pos]; objl != NON_ITEM; + bool canceled_butcher = false; + bool found_nonzero_corpses = false; + for (int objl = igrd[you.x_pos][you.y_pos]; objl != NON_ITEM; objl = mitm[objl].link) { if ( (mitm[objl].base_type != OBJ_CORPSES) || (mitm[objl].sub_type != CORPSE_BODY) ) continue; + found_nonzero_corpses = true; + // offer the possibility of butchering it_name(objl, DESC_NOCAP_A, str_pass); snprintf(info, INFO_SIZE, "Butcher %s?", str_pass); int answer = yesnoquit( info, true, 'n', false ); if ( answer == -1 ) + { + canceled_butcher = true; break; + } if ( answer == 0 ) continue; @@ -327,10 +332,15 @@ bool butchery(void) return true; } - - mpr("There isn't anything to dissect here."); - if (!new_cursed && wpn_switch) { // should never happen + if (canceled_butcher) + canned_msg(MSG_OK); + else + mprf("There isn't anything %sto dissect here.", + found_nonzero_corpses? "else " : ""); + + if (!new_cursed && wpn_switch) // should never happen + { weapon_switch( old_weapon ); } diff --git a/crawl-ref/source/travel.cc b/crawl-ref/source/travel.cc index 4fa02e4764..1ad2b3be59 100644 --- a/crawl-ref/source/travel.cc +++ b/crawl-ref/source/travel.cc @@ -833,7 +833,8 @@ static void explore_find_target_square() // No place to go? Report to the player. const int estatus = find_explore_status(tp); - if (!estatus) { + if (!estatus) + { mpr("Done exploring."); learned_something_new(TUT_DONE_EXPLORE); } @@ -1049,7 +1050,8 @@ command_type travel() return direction_to_command( *move_x, *move_y ); } -command_type direction_to_command( char x, char y ) { +command_type direction_to_command( char x, char y ) +{ if ( x == -1 && y == -1 ) return CMD_MOVE_UP_LEFT; if ( x == -1 && y == 0 ) return CMD_MOVE_LEFT; if ( x == -1 && y == 1 ) return CMD_MOVE_DOWN_LEFT; -- cgit v1.2.3-54-g00ecf