diff options
-rw-r--r-- | crawl-ref/source/items.cc | 17 | ||||
-rw-r--r-- | crawl-ref/source/place.cc | 7 | ||||
-rw-r--r-- | crawl-ref/source/place.h | 2 |
3 files changed, 18 insertions, 8 deletions
diff --git a/crawl-ref/source/items.cc b/crawl-ref/source/items.cc index c50d7e5efc..7e873542d2 100644 --- a/crawl-ref/source/items.cc +++ b/crawl-ref/source/items.cc @@ -522,15 +522,16 @@ void destroy_item( int dest ) static void handle_gone_item(const item_def &item) { - if (item.base_type == OBJ_ORBS) + if (you.level_type == LEVEL_ABYSS + && place_type(item.orig_place) == LEVEL_ABYSS + && !(item.flags & ISFLAG_BEEN_IN_INV)) { - set_unique_item_status(OBJ_ORBS, item.sub_type, - UNIQ_LOST_IN_ABYSS); - } - else if (is_fixed_artefact(item)) - { - set_unique_item_status(OBJ_WEAPONS, item.special, - UNIQ_LOST_IN_ABYSS); + if (item.base_type == OBJ_ORBS) + set_unique_item_status(OBJ_ORBS, item.sub_type, + UNIQ_LOST_IN_ABYSS); + else if (is_fixed_artefact(item)) + set_unique_item_status(OBJ_WEAPONS, item.special, + UNIQ_LOST_IN_ABYSS); } if (is_rune(item)) diff --git a/crawl-ref/source/place.cc b/crawl-ref/source/place.cc index 67de365065..7e469b4b28 100644 --- a/crawl-ref/source/place.cc +++ b/crawl-ref/source/place.cc @@ -37,6 +37,13 @@ int place_depth(unsigned short place) return lev == 0xFF? -1 : lev; } +int place_type(unsigned short place) +{ + const unsigned type = (unsigned) ((place >> 8) & 0xFF); + const int lev = place & 0xFF; + return lev == 0xFF? (int) type : (int) LEVEL_DUNGEON; +} + unsigned short get_packed_place( branch_type branch, int subdepth, level_area_type level_type ) { diff --git a/crawl-ref/source/place.h b/crawl-ref/source/place.h index 078db1f571..f62f0b57b9 100644 --- a/crawl-ref/source/place.h +++ b/crawl-ref/source/place.h @@ -25,6 +25,8 @@ unsigned short get_packed_place( branch_type branch, int subdepth, int place_branch(unsigned short place); int place_depth(unsigned short place); +int place_type(unsigned short place); + std::string short_place_name(unsigned short place); std::string short_place_name(level_id id); std::string place_name( unsigned short place, bool long_name = false, |