summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/state.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-26 10:39:39 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-26 10:39:39 +0000
commit61cae4a761c2f72cda44ae269c7007b37a0c14a7 (patch)
treefec8ec71ca7ca6eebd9d48881bc5ee3fe27d04c1 /crawl-ref/source/state.cc
parentd4acdf4a6a4b73607d58714a66efd372674adb56 (diff)
downloadcrawl-ref-61cae4a761c2f72cda44ae269c7007b37a0c14a7.tar.gz
crawl-ref-61cae4a761c2f72cda44ae269c7007b37a0c14a7.zip
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
Diffstat (limited to 'crawl-ref/source/state.cc')
-rw-r--r--crawl-ref/source/state.cc35
1 files changed, 18 insertions, 17 deletions
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<const monsters*>(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()