summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/enum.h
diff options
context:
space:
mode:
authorMatthew Cline <zelgadis@sourceforge.net>2009-11-03 18:34:01 -0800
committerMatthew Cline <zelgadis@sourceforge.net>2009-11-03 18:36:53 -0800
commit1bf203aaf578284d268fdca67c9d334a79a53c0d (patch)
treefe95bb3876906713ce7ce33c14e7d3778b53324c /crawl-ref/source/enum.h
parent20161f77a87bf5ef908369863755304ea011a8bd (diff)
downloadcrawl-ref-1bf203aaf578284d268fdca67c9d334a79a53c0d.tar.gz
crawl-ref-1bf203aaf578284d268fdca67c9d334a79a53c0d.zip
Fixed MONS_NO_MONSTER == NUM_MONSTERS + 1
Fixed MONS_NO_MONSTER == NUM_MONSTERS + 1, which was a problem because MONS_NO_MONSTER can end up in savefiles, meaning that when NUM_MONSTERS increased old save files would become broken. unmarshall_monster() has a temporary hack to preserve compatibility with old save files, and will fail a COMPILE_CHECK() when NUM_MONSTERS increases beyond its current value.
Diffstat (limited to 'crawl-ref/source/enum.h')
-rw-r--r--crawl-ref/source/enum.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h
index e675ff2059..a0b94c81c5 100644
--- a/crawl-ref/source/enum.h
+++ b/crawl-ref/source/enum.h
@@ -2099,10 +2099,13 @@ enum monster_type // (int) menv[].type
MONS_TEST_SPAWNER,
NUM_MONSTERS, // used for polymorph
- MONS_NO_MONSTER,
+
+ // MONS_NO_MONSTER can get put in savefiles, so it shouldn't change
+ // when NUM_MONSTERS increases.
+ MONS_NO_MONSTER = 1000,
MONS_PLAYER,
- RANDOM_MONSTER = 1000, // used to distinguish between a random monster and using program bugs for error trapping {dlb}
+ RANDOM_MONSTER = 2000, // used to distinguish between a random monster and using program bugs for error trapping {dlb}
// A random draconian, either base coloured drac or specialised.
RANDOM_DRACONIAN,
@@ -2113,7 +2116,7 @@ enum monster_type // (int) menv[].type
// Any random specialised draconian, such as a draconian knight.
RANDOM_NONBASE_DRACONIAN,
- WANDERING_MONSTER = 2500 // only used in monster placement routines - forced limit checks {dlb}
+ WANDERING_MONSTER = 3500 // only used in monster placement routines - forced limit checks {dlb}
};