summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/directn.cc
diff options
context:
space:
mode:
authorreaverb <reaverb.Crawl@gmail.com>2014-07-28 23:43:19 -0400
committerreaverb <reaverb.Crawl@gmail.com>2014-07-28 23:50:11 -0400
commita50151252405168a7c498fd1c9363310b7d3997e (patch)
tree7b422b0cb33d7e86718d3b5b93b866987ebcad50 /crawl-ref/source/directn.cc
parent71fb0069df3cae576ac83bf2c345991d1c7ff8b9 (diff)
downloadcrawl-ref-a50151252405168a7c498fd1c9363310b7d3997e.tar.gz
crawl-ref-a50151252405168a7c498fd1c9363310b7d3997e.zip
Move a function (tobool, 1 args) from stuff.cc -> directn.cc
Diffstat (limited to 'crawl-ref/source/directn.cc')
-rw-r--r--crawl-ref/source/directn.cc12
1 files changed, 9 insertions, 3 deletions
diff --git a/crawl-ref/source/directn.cc b/crawl-ref/source/directn.cc
index d754cf7723..96c14ecc83 100644
--- a/crawl-ref/source/directn.cc
+++ b/crawl-ref/source/directn.cc
@@ -2425,6 +2425,12 @@ static bool _want_target_monster(const monster *mon, int mode)
return !mons_class_flag(mon->type, M_NO_EXP_GAIN);
}
+static bool _tobool(maybe_bool mb)
+{
+ ASSERT(mb != MB_MAYBE);
+ return mb == MB_TRUE;
+}
+
static bool _find_monster(const coord_def& where, int mode, bool need_path,
int range, targetter *hitfunc)
{
@@ -2435,7 +2441,7 @@ static bool _find_monster(const coord_def& where, int mode, bool need_path,
maybe_bool x = clua.callmbooleanfn("ch_target_monster", "dd",
dp.x, dp.y);
if (x != MB_MAYBE)
- return tobool(x);
+ return _tobool(x);
}
#endif
@@ -2476,7 +2482,7 @@ static bool _find_jump_attack_mons(const coord_def& where, int mode, bool need_p
maybe_bool x = clua.callmbooleanfn("ch_target_jump", "dd",
dp.x, dp.y);
if (x != MB_MAYBE)
- return tobool(x);
+ return _tobool(x);
}
#endif
@@ -2505,7 +2511,7 @@ static bool _find_monster_expl(const coord_def& where, int mode, bool need_path,
maybe_bool x = clua.callmbooleanfn("ch_target_monster_expl", "dd",
dp.x, dp.y);
if (x != MB_MAYBE)
- return tobool(x);
+ return _tobool(x);
}
#endif