summaryrefslogtreecommitdiff
path: root/src/net/tmwa
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-02-26 13:35:24 +0300
committerAndrei Karas <akaras@inbox.ru>2013-02-26 13:35:24 +0300
commit5190fe2cdac7c259d96619e4686f8543bdc96af4 (patch)
tree3a49895b4371fcd58a2446c0b3b0128ca1933568 /src/net/tmwa
parentd4febba47388979b26cd4680cb8a6f20e548e399 (diff)
downloadmanaverse-5190fe2cdac7c259d96619e4686f8543bdc96af4.tar.gz
manaverse-5190fe2cdac7c259d96619e4686f8543bdc96af4.tar.bz2
manaverse-5190fe2cdac7c259d96619e4686f8543bdc96af4.tar.xz
manaverse-5190fe2cdac7c259d96619e4686f8543bdc96af4.zip
Improve string usage in other files.
Diffstat (limited to 'src/net/tmwa')
-rw-r--r--src/net/tmwa/chathandler.cpp3
-rw-r--r--src/net/tmwa/guildhandler.cpp3
2 files changed, 4 insertions, 2 deletions
diff --git a/src/net/tmwa/chathandler.cpp b/src/net/tmwa/chathandler.cpp
index 9147a448a..723a164f2 100644
--- a/src/net/tmwa/chathandler.cpp
+++ b/src/net/tmwa/chathandler.cpp
@@ -109,7 +109,8 @@ void ChatHandler::talk(const std::string &text)
if (!player_node)
return;
- std::string mes = player_node->getName() + " : " + text;
+ std::string mes = std::string(player_node->getName()).append(
+ " : ").append(text);
MessageOut outMsg(CMSG_CHAT_MESSAGE);
// Added + 1 in order to let eAthena parse admin commands correctly
diff --git a/src/net/tmwa/guildhandler.cpp b/src/net/tmwa/guildhandler.cpp
index 96d1c9a9d..4e1ceba08 100644
--- a/src/net/tmwa/guildhandler.cpp
+++ b/src/net/tmwa/guildhandler.cpp
@@ -266,7 +266,8 @@ void GuildHandler::chat(int guildId A_UNUSED, const std::string &text)
if (!player_node)
return;
- std::string str = player_node->getName() + " : " + text;
+ std::string str = std::string(player_node->getName()).append(
+ " : ").append(text);
MessageOut msg(CMSG_GUILD_MESSAGE);
msg.writeInt16(static_cast<uint16_t>(str.size() + 4));
msg.writeString(str, static_cast<int>(str.length()));