From 61cae4a761c2f72cda44ae269c7007b37a0c14a7 Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Thu, 26 Jun 2008 10:39:39 +0000 Subject: Misc. minor cleanups. (Yes, a huge amount of them but still...) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6146 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/state.cc | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) (limited to 'crawl-ref/source/state.cc') diff --git a/crawl-ref/source/state.cc b/crawl-ref/source/state.cc index 7ed5d08de1..ae00ab869a 100644 --- a/crawl-ref/source/state.cc +++ b/crawl-ref/source/state.cc @@ -96,7 +96,7 @@ void game_state::cancel_cmd_repeat(std::string reason) reset_cmd_repeat(); - if (reason != "") + if (!reason.empty()) mpr(reason.c_str()); } @@ -112,13 +112,13 @@ void game_state::cancel_cmd_again(std::string reason) reset_cmd_again(); - if (reason != "") + if (!reason.empty()) mpr(reason.c_str()); } void game_state::cant_cmd_repeat(std::string reason) { - if (reason == "") + if (reason.empty()) reason = "Can't repeat that command."; cancel_cmd_repeat(reason); @@ -126,7 +126,7 @@ void game_state::cant_cmd_repeat(std::string reason) void game_state::cant_cmd_again(std::string reason) { - if (reason == "") + if (reason.empty()) reason = "Can't redo that command."; cancel_cmd_again(reason); @@ -147,10 +147,10 @@ bool interrupt_cmd_repeat( activity_interrupt_type ai, const activity_interrupt_data &at ) { if (crawl_state.cmd_repeat_start) - return false; + return (false); if (crawl_state.repeat_cmd == CMD_WIZARD) - return false; + return (false); switch (ai) { @@ -161,7 +161,7 @@ bool interrupt_cmd_repeat( activity_interrupt_type ai, case AI_HP_LOSS: case AI_MONSTER_ATTACKS: crawl_state.cancel_cmd_repeat("Command repetition interrupted."); - return true; + return (true); default: break; @@ -171,12 +171,12 @@ bool interrupt_cmd_repeat( activity_interrupt_type ai, { const monsters* mon = static_cast(at.data); if (!mon->visible()) - return false; + return (false); if (crawl_state.cmd_repeat_started_unsafe && at.context != "newly seen") { - return false; + return (false); } crawl_state.cancel_cmd_repeat(); @@ -196,12 +196,12 @@ bool interrupt_cmd_repeat( activity_interrupt_type ai, fs.cprintf("%s (", mon->name(DESC_PLAIN, true).c_str()); fs.add_glyph( mon ); fs.cprintf(") in view: (%d,%d), see_grid: %s", - mon->x, mon->y, - see_grid(mon->x, mon->y)? "yes" : "no"); + mon->x, mon->y, + see_grid(mon->x, mon->y)? "yes" : "no"); formatted_mpr(fs, MSGCH_WARN); #endif - return true; + return (true); } // If command repitition is being used to immitate the rest command, @@ -215,11 +215,12 @@ bool interrupt_cmd_repeat( activity_interrupt_type ai, crawl_state.cancel_cmd_repeat("HP restored."); else crawl_state.cancel_cmd_repeat("Command repetition interrupted."); - return true; + + return (true); } if (crawl_state.cmd_repeat_started_unsafe) - return false; + return (false); if (ai == AI_HIT_MONSTER) { @@ -231,14 +232,14 @@ bool interrupt_cmd_repeat( activity_interrupt_type ai, if (mons_class_flag(mon->type, M_NO_EXP_GAIN) && player_monster_visible(mon)) { - return false; + return (false); } crawl_state.cancel_cmd_repeat("Command repetition interrupted."); - return true; + return (true); } - return false; + return (false); } void game_state::reset_cmd_repeat() -- cgit v1.2.3-54-g00ecf