summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spl-miscast.cc
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2013-06-08 20:29:11 +0200
committerAdam Borowski <kilobyte@angband.pl>2013-06-08 20:29:11 +0200
commitae1dc47dc5b5f48957eb44396ab153acc38ef712 (patch)
treedb3ffa00832ac001005b52002abc1650cd7f426b /crawl-ref/source/spl-miscast.cc
parent258af752a1d6f6dc337c97e8ceabf26bcb974f31 (diff)
downloadcrawl-ref-ae1dc47dc5b5f48957eb44396ab153acc38ef712.tar.gz
crawl-ref-ae1dc47dc5b5f48957eb44396ab153acc38ef712.zip
ASSERT_RANGEs other than >= <.
Committing separately as I'm not sure whether checking, for example, ASSERT_RANGE(level, 1, 28) is that nice. Perhaps 27 + 1 could be better? Perhaps some other syntax?
Diffstat (limited to 'crawl-ref/source/spl-miscast.cc')
-rw-r--r--crawl-ref/source/spl-miscast.cc6
1 files changed, 2 insertions, 4 deletions
diff --git a/crawl-ref/source/spl-miscast.cc b/crawl-ref/source/spl-miscast.cc
index 169ad0572a..d67d42d134 100644
--- a/crawl-ref/source/spl-miscast.cc
+++ b/crawl-ref/source/spl-miscast.cc
@@ -85,8 +85,7 @@ MiscastEffect::MiscastEffect(actor* _target, int _source,
ASSERT(!_cause.empty());
ASSERT(count_bits(_school) == 1);
ASSERT(_school <= SPTYP_LAST_SCHOOL || _school == SPTYP_RANDOM);
- ASSERT(level >= 0);
- ASSERT(level <= 3);
+ ASSERT_RANGE(level, 0, 3 + 1);
init();
do_miscast();
@@ -255,8 +254,7 @@ string MiscastEffect::get_default_cause(bool attribute_to_user) const
{
// This is only for true miscasts, which means both a spell and that
// the source of the miscast is the same as the target of the miscast.
- ASSERT(source >= 0);
- ASSERT(source <= NON_MONSTER);
+ ASSERT_RANGE(source, 0, NON_MONSTER + 1);
ASSERT(spell != SPELL_NO_SPELL);
ASSERT(school == SPTYP_NONE);