summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/externs.h
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2012-03-26 23:51:31 +0200
committerAdam Borowski <kilobyte@angband.pl>2012-03-26 23:56:36 +0200
commit2c8c99fec4aab48970d75030ece87dda40260e78 (patch)
treeed687319685e936cb25b8fa046c01209c36c7525 /crawl-ref/source/externs.h
parent01c2aa8463804cdd4ff8818b78c1deb890a78efb (diff)
parent537a8dfbb6582c8269e3239b63a5d2ea03eb77a3 (diff)
downloadcrawl-ref-2c8c99fec4aab48970d75030ece87dda40260e78.tar.gz
crawl-ref-2c8c99fec4aab48970d75030ece87dda40260e78.zip
Merge branch 'master' into portal_branches
This includes fixes for 64834896234968 places in master that add new uses of LEVEL_FOO and so on.
Diffstat (limited to 'crawl-ref/source/externs.h')
-rw-r--r--crawl-ref/source/externs.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/crawl-ref/source/externs.h b/crawl-ref/source/externs.h
index 01a1f1cffc..a7aabbade9 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;
@@ -510,10 +516,10 @@ 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
- uint8_t colour; // item colour
+ colour_t colour; // item colour
uint8_t rnd; // random number, used for tile choice
short quantity; // number of items
iflags_t flags; // item status flags