diff options
-rw-r--r-- | crawl-ref/source/enum.h | 9 | ||||
-rw-r--r-- | crawl-ref/source/tags.cc | 10 |
2 files changed, 16 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} }; diff --git a/crawl-ref/source/tags.cc b/crawl-ref/source/tags.cc index 04e6102d32..9300e7329b 100644 --- a/crawl-ref/source/tags.cc +++ b/crawl-ref/source/tags.cc @@ -2217,6 +2217,16 @@ static void unmarshall_monster(reader &th, monsters &m) m.set_ghost(unmarshallGhost(th, _tag_minor_version)); m.check_speed(); + + // XXX: Changed MONS_NO_MONSTER from NUM_MONSTERS + 1 to 1000. + // This is a temporary hack, remove when the following compile + // time assert fails. + COMPILE_CHECK(NUM_MONSTERS == 472, c1); + + if (m.type == (NUM_MONSTERS + 1)) + m.type = MONS_NO_MONSTER; + if (m.base_monster == (NUM_MONSTERS + 1)) + m.base_monster = MONS_NO_MONSTER; } static void tag_read_level_monsters(reader &th, char minorVersion) |