diff options
author | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2006-12-29 12:38:49 +0000 |
---|---|---|
committer | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2006-12-29 12:38:49 +0000 |
commit | 883d0ce492391cc7cfeed1836b4a4e5fc5f4b24e (patch) | |
tree | 89a877ee214edcab9867b8850cb381432ae2d600 /crawl-ref/source/itemname.cc | |
parent | b69356ae0558ebc5431444fce3c9b0636e2812b5 (diff) | |
download | crawl-ref-883d0ce492391cc7cfeed1836b4a4e5fc5f4b24e.tar.gz crawl-ref-883d0ce492391cc7cfeed1836b4a4e5fc5f4b24e.zip |
Hopefully, finally squashed the stacking bug.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@728 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/itemname.cc')
-rw-r--r-- | crawl-ref/source/itemname.cc | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/crawl-ref/source/itemname.cc b/crawl-ref/source/itemname.cc index 46f7956aca..56f477c5ca 100644 --- a/crawl-ref/source/itemname.cc +++ b/crawl-ref/source/itemname.cc @@ -2344,19 +2344,24 @@ bool is_interesting_item( const item_def& item ) { return false; } -bool fully_identified( const item_def& item ) { - long flagset = ISFLAG_IDENT_MASK; - switch ( item.base_type ) { +// Returns the mask of interesting identify bits for this item +// (e.g., scrolls don't have know-cursedness.) +unsigned long full_ident_mask( const item_def& item ) +{ + unsigned long flagset = ISFLAG_IDENT_MASK; + switch ( item.base_type ) + { + case OBJ_FOOD: + flagset = 0; + break; case OBJ_BOOKS: case OBJ_MISCELLANY: case OBJ_ORBS: case OBJ_SCROLLS: case OBJ_POTIONS: + case OBJ_STAVES: flagset = ISFLAG_KNOW_TYPE; break; - case OBJ_FOOD: - flagset = 0; - break; case OBJ_WANDS: flagset = (ISFLAG_KNOW_TYPE | ISFLAG_KNOW_PLUSES); break; @@ -2365,6 +2370,11 @@ bool fully_identified( const item_def& item ) { if ( ring_has_pluses(item) ) flagset |= ISFLAG_KNOW_PLUSES; break; + case OBJ_MISSILES: + flagset = ISFLAG_KNOW_PLUSES | ISFLAG_KNOW_TYPE; + break; + case OBJ_WEAPONS: + case OBJ_ARMOUR: default: break; } @@ -2372,6 +2382,10 @@ bool fully_identified( const item_def& item ) { is_fixed_artefact(item) || is_unrandom_artefact(item) ) flagset |= ISFLAG_KNOW_PROPERTIES; - - return item_ident( item, flagset ); + return flagset; +} + +bool fully_identified( const item_def& item ) +{ + return item_ident(item, full_ident_mask(item)); } |