summaryrefslogtreecommitdiff
path: root/src/shopitem.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-02-24 22:59:54 +0300
committerAndrei Karas <akaras@inbox.ru>2013-02-24 22:59:54 +0300
commit6ce49efadfadd8eacb048df274979736bb04daf0 (patch)
tree60d4c2c2a803db003f6fa28e932468e925112580 /src/shopitem.cpp
parent466829aef10af6b95d0f443226e8549f4399b567 (diff)
downloadmanaverse-6ce49efadfadd8eacb048df274979736bb04daf0.tar.gz
manaverse-6ce49efadfadd8eacb048df274979736bb04daf0.tar.bz2
manaverse-6ce49efadfadd8eacb048df274979736bb04daf0.tar.xz
manaverse-6ce49efadfadd8eacb048df274979736bb04daf0.zip
Improve string usage in some files.
Diffstat (limited to 'src/shopitem.cpp')
-rw-r--r--src/shopitem.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/shopitem.cpp b/src/shopitem.cpp
index d0a3cce4d..831b8cd43 100644
--- a/src/shopitem.cpp
+++ b/src/shopitem.cpp
@@ -38,16 +38,16 @@ ShopItem::ShopItem(const int inventoryIndex, const int id,
{
if (serverVersion > 0)
{
- mDisplayName = getInfo().getName(color) + " ("
- + Units::formatCurrency(mPrice).c_str() + ") ";
+ mDisplayName = std::string(getInfo().getName(color)).append(" (")
+ .append(Units::formatCurrency(mPrice)).append(") ");
}
else
{
- mDisplayName = getInfo().getName() + " ("
- + Units::formatCurrency(mPrice).c_str() + ") ";
+ mDisplayName = std::string(getInfo().getName()).append(" (")
+ .append(Units::formatCurrency(mPrice)).append(") ");
}
if (quantity > 0)
- mDisplayName += "[" + toString(quantity) + "]";
+ mDisplayName.append("[").append(toString(quantity)).append("]");
setInvIndex(inventoryIndex);
addDuplicate(inventoryIndex, quantity);
@@ -60,13 +60,13 @@ ShopItem::ShopItem (const int id, const unsigned char color, const int price) :
{
if (serverVersion > 0)
{
- mDisplayName = getInfo().getName(color) +
- " (" + Units::formatCurrency(mPrice).c_str() + ")";
+ mDisplayName = std::string(getInfo().getName(color)).append(" (")
+ .append(Units::formatCurrency(mPrice)).append(")");
}
else
{
- mDisplayName = getInfo().getName() +
- " (" + Units::formatCurrency(mPrice).c_str() + ")";
+ mDisplayName = std::string(getInfo().getName()).append(" (")
+ .append(Units::formatCurrency(mPrice)).append(")");
}
setInvIndex(-1);
addDuplicate(-1, 0);
@@ -88,16 +88,16 @@ void ShopItem::update()
{
if (serverVersion > 0)
{
- mDisplayName = getInfo().getName(mColor) + " ("
- + Units::formatCurrency(mPrice).c_str() + ") ";
+ mDisplayName = std::string(getInfo().getName(mColor)).append(" (")
+ .append(Units::formatCurrency(mPrice)).append(") ");
}
else
{
- mDisplayName = getInfo().getName() + " ("
- + Units::formatCurrency(mPrice).c_str() + ") ";
+ mDisplayName = std::string(getInfo().getName()).append(" (")
+ .append(Units::formatCurrency(mPrice)).append(") ");
}
if (mQuantity > 0)
- mDisplayName += "[" + toString(mQuantity) + "]";
+ mDisplayName.append("[").append(toString(mQuantity)).append("]");
}
}