summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/tiledoll.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/tiledoll.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/tiledoll.cc')
-rw-r--r--crawl-ref/source/tiledoll.cc6
1 files changed, 2 insertions, 4 deletions
diff --git a/crawl-ref/source/tiledoll.cc b/crawl-ref/source/tiledoll.cc
index 205801a746..fd33a17298 100644
--- a/crawl-ref/source/tiledoll.cc
+++ b/crawl-ref/source/tiledoll.cc
@@ -219,16 +219,14 @@ void init_player_doll()
static int _get_random_doll_part(int p)
{
- ASSERT(p >= 0);
- ASSERT(p <= TILEP_PART_MAX);
+ ASSERT_RANGE(p, 0, TILEP_PART_MAX + 1);
return (tile_player_part_start[p]
+ random2(tile_player_part_count[p]));
}
static void _fill_doll_part(dolls_data &doll, int p)
{
- ASSERT(p >= 0);
- ASSERT(p <= TILEP_PART_MAX);
+ ASSERT_RANGE(p, 0, TILEP_PART_MAX + 1);
doll.parts[p] = _get_random_doll_part(p);
}