diff options
-rw-r--r-- | crawl-ref/source/item_use.cc | 3 | ||||
-rw-r--r-- | crawl-ref/source/libutil.cc | 2 | ||||
-rw-r--r-- | crawl-ref/source/travel.cc | 24 |
3 files changed, 19 insertions, 10 deletions
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc index 060b994f5b..212e2ea00e 100644 --- a/crawl-ref/source/item_use.cc +++ b/crawl-ref/source/item_use.cc @@ -479,7 +479,8 @@ void wield_effects(int item_wield_2, bool showMsgs) case SPWPN_ELECTROCUTION: if (!silenced(you.x_pos, you.y_pos)) - mpr("You hear the crackle of electricity.", MSGCH_SOUND); + mpr("You hear the crackle of electricity.", + MSGCH_SOUND); else mpr("You see sparks fly."); break; diff --git a/crawl-ref/source/libutil.cc b/crawl-ref/source/libutil.cc index 001e3c7128..ef40fe2af3 100644 --- a/crawl-ref/source/libutil.cc +++ b/crawl-ref/source/libutil.cc @@ -297,6 +297,8 @@ std::string pluralise(const std::string &name, else if (ends_with(name, "efreet")) // efreet -> efreeti. Not sure this is correct. return name + "i"; + else if (ends_with(name, "staff")) + return name.substr(0, name.length() - 2) + "ves"; return name + "s"; } diff --git a/crawl-ref/source/travel.cc b/crawl-ref/source/travel.cc index eb87f9ea47..2b9af1ac94 100644 --- a/crawl-ref/source/travel.cc +++ b/crawl-ref/source/travel.cc @@ -3783,18 +3783,24 @@ void explore_discoveries::add_stair( void explore_discoveries::add_item(const item_def &i) { - if (is_stackable_item(i)) + item_def copy = i; + copy.quantity = 1; + const std::string cname = copy.name(DESC_PLAIN); + + // Try to find something to stack it with, stacking by name. + for (int j = 0, size = items.size(); j < size; ++j) { - // Try to find something to stack it with. - for (int j = 0, size = items.size(); j < size; ++j) + const int orig_quantity = items[j].thing.quantity; + items[j].thing.quantity = 1; + if (cname == items[j].thing.name(DESC_PLAIN)) { - if (items_stack(i, items[j].thing)) - { - items[j].thing.quantity += i.quantity; - items[j].name = items[j].thing.name(DESC_NOCAP_A); - return; - } + items[j].thing.quantity = orig_quantity + i.quantity; + items[j].name = + items[j].thing.name(DESC_NOCAP_A, false, false, true, + !is_stackable_item(i)); + return; } + items[j].thing.quantity = orig_quantity; } items.push_back( named_thing<item_def>(i.name(DESC_NOCAP_A), i) ); |