summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-util.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-03-20 17:57:17 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-03-20 17:57:17 +0000
commite55e12b955d739545cf587d04fcb840ef6470f13 (patch)
tree977f8f44391d29381aab0276d4d67ab526358722 /crawl-ref/source/mon-util.cc
parent0b103119bb91d60929ddd2a016395698778151d7 (diff)
downloadcrawl-ref-e55e12b955d739545cf587d04fcb840ef6470f13.tar.gz
crawl-ref-e55e12b955d739545cf587d04fcb840ef6470f13.zip
Improve the previous sanity fixes. Add a function
invalid_monster_index(), and use that where applicable. Also, put the "god gift" flag back on orcish followers, since the Crusade card now handles orc conversion properly for Beoghites, and so that the index check doesn't have to be done twice for collateral kills. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3755 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/mon-util.cc')
-rw-r--r--crawl-ref/source/mon-util.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc
index 1bbdc16114..96465c7c1e 100644
--- a/crawl-ref/source/mon-util.cc
+++ b/crawl-ref/source/mon-util.cc
@@ -469,6 +469,13 @@ bool invalid_monster_class(int mclass)
|| mon_entry[mclass] == MONS_PROGRAM_BUG);
}
+bool invalid_monster_index(int i)
+{
+ return (i != ANON_FRIENDLY_MONSTER
+ && i >= 0
+ && i < MAX_MONSTERS);
+}
+
bool mons_is_statue(int mc)
{
return (mc == MONS_ORANGE_STATUE