summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/macro.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/macro.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/macro.cc')
-rw-r--r--crawl-ref/source/macro.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/crawl-ref/source/macro.cc b/crawl-ref/source/macro.cc
index a77b898505..cb2c5e4cc6 100644
--- a/crawl-ref/source/macro.cc
+++ b/crawl-ref/source/macro.cc
@@ -473,8 +473,7 @@ void macro_buf_add(int key, bool reverse, bool expanded)
*/
void macro_buf_add_cmd(command_type cmd, bool reverse)
{
- ASSERT(cmd > CMD_NO_CMD);
- ASSERT(cmd < CMD_MIN_SYNTHETIC);
+ ASSERT_RANGE(cmd, CMD_NO_CMD + 1, CMD_MIN_SYNTHETIC);
// There should be plenty of room between the synthetic keys
// (KEY_MACRO_MORE_PROTECT == -10) and USERFUNCBASE (-10000) for