diff options
Diffstat (limited to 'crawl-ref/source/stash.cc')
-rw-r--r-- | crawl-ref/source/stash.cc | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/crawl-ref/source/stash.cc b/crawl-ref/source/stash.cc index cb3a461b61..147dbc67d8 100644 --- a/crawl-ref/source/stash.cc +++ b/crawl-ref/source/stash.cc @@ -887,21 +887,15 @@ void ShopInfo::add_item(const item_def &sitem, unsigned price) std::string ShopInfo::shop_item_name(const shop_item &si) const { - char shopitem[ITEMNAME_SIZE * 2]; - const unsigned long oldflags = si.item.flags; if (shoptype_identifies_stock(static_cast<shop_type>(this->shoptype))) const_cast<shop_item&>(si).item.flags |= ISFLAG_IDENT_MASK; - const std::string itemname = Stash::stash_item_name(si.item); - snprintf(shopitem, sizeof shopitem, "%s (%u gold)", - itemname.c_str(), si.price); - if (oldflags != si.item.flags) const_cast<shop_item&>(si).item.flags = oldflags; - return shopitem; + return make_stringf("%s (%u gold)", Stash::stash_item_name(si.item).c_str(), si.price); } std::string ShopInfo::shop_item_desc(const shop_item &si) const @@ -1871,12 +1865,9 @@ void StashSearchMenu::draw_title() title->quantity > 1? "es" : "", sort_style); - char buf[200]; - snprintf(buf, 200, + draw_title_suffix(formatted_string::parse_string(make_stringf( "<lightgrey> [<w>a-z</w>: %s <w>?</w>/<w>!</w>: change action <w>/</w>: change sort]", - menu_action == ACT_EXECUTE ? "travel" : "examine"); - - draw_title_suffix(formatted_string::parse_string(buf), false); + menu_action == ACT_EXECUTE ? "travel" : "examine")), false); } } |