summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/externs.h
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2012-03-22 15:53:30 +0100
committerAdam Borowski <kilobyte@angband.pl>2012-03-22 22:54:42 +0100
commit889c096052179aa37a048ee9ed35153a6bbe30f1 (patch)
tree9b6e9a9a4ba9eec31783d1fe4f35d6ca57102b5e /crawl-ref/source/externs.h
parent3565ecf6be49a441389505484de12b63b42d3bc2 (diff)
downloadcrawl-ref-889c096052179aa37a048ee9ed35153a6bbe30f1.tar.gz
crawl-ref-889c096052179aa37a048ee9ed35153a6bbe30f1.zip
Use monster_type nearly everywhere.
Omitted: * mspec.type (uses a lot of magic values in the negatives) * item_def.orig_monnum (todo, +1 trick) A few minor problems are fixed here: * renamed gas spores passed mindex for monster_type * demon summoning would break on addition/deletion of demon types * vaults spawning zombified uniques would fail to mark them as used
Diffstat (limited to 'crawl-ref/source/externs.h')
-rw-r--r--crawl-ref/source/externs.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/crawl-ref/source/externs.h b/crawl-ref/source/externs.h
index c0020ed5cb..2d9bfb705e 100644
--- a/crawl-ref/source/externs.h
+++ b/crawl-ref/source/externs.h
@@ -278,6 +278,12 @@ typedef uint32_t mid_t;
// and whatever else we want to have, while keeping all monster ids smaller.
#define MID_ANON_FRIEND ((mid_t)0xffff0000)
+static inline monster_type operator++(monster_type &x)
+{
+ x = static_cast<monster_type>(x + 1);
+ return x;
+}
+
struct cloud_struct
{
coord_def pos;
@@ -529,7 +535,7 @@ struct item_def
{
object_class_type base_type:8; // basic class (ie OBJ_WEAPON)
uint8_t sub_type; // type within that class (ie WPN_DAGGER)
- short plus; // +to hit, charges, corpse mon id
+ union { short plus; monster_type mon_type:16; }; // +to hit, charges, corpse mon id
short plus2; // +to dam, sub-sub type for boots/helms
int special; // special stuff
colour_t colour; // item colour