From 928479a2ce6674d27d6ef03d7a06f81803ccdfae Mon Sep 17 00:00:00 2001 From: Robert Vollmert Date: Tue, 27 Oct 2009 01:35:41 +0100 Subject: Convert some ints to monster_type. There's a whole lot of places that pass monster_type as int, often with varying meanings for the value -1. This moves some of these to monster_type, introducing MONS_NO_MONSTER and MONS_PLAYER as new invalid special values. Also improve on the autoexclude descriptions. --- crawl-ref/source/tags.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crawl-ref/source/tags.cc') diff --git a/crawl-ref/source/tags.cc b/crawl-ref/source/tags.cc index ab02149019..6678f498de 100644 --- a/crawl-ref/source/tags.cc +++ b/crawl-ref/source/tags.cc @@ -2174,7 +2174,7 @@ static void unmarshall_monster(reader &th, monsters &m) } m.ench_countdown = unmarshallByte(th); - m.type = unmarshallShort(th); + m.type = static_cast(unmarshallShort(th)); m.hit_points = unmarshallShort(th); m.max_hit_points = unmarshallShort(th); m.number = unmarshallShort(th); @@ -2217,7 +2217,7 @@ static void tag_read_level_monsters(reader &th, char minorVersion) monsters &m = menv[i]; unmarshall_monster(th, m); // place monster - if (m.type != -1) + if (m.type != MONS_NO_MONSTER) { #if defined(DEBUG) || defined(DEBUG_MONS_SCAN) int midx = mgrd(m.pos()); -- cgit v1.2.3-54-g00ecf