summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/gui/chat.cpp11
-rw-r--r--src/gui/chat.h2
2 files changed, 7 insertions, 6 deletions
diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp
index e37bdf78..f7acda04 100644
--- a/src/gui/chat.cpp
+++ b/src/gui/chat.cpp
@@ -294,7 +294,7 @@ void ChatWindow::addTab(ChatTab *tab)
logic();
}
-void ChatWindow::removeWhisper(std::string nick)
+void ChatWindow::removeWhisper(const std::string &nick)
{
mWhispers.erase(nick);
}
@@ -309,8 +309,8 @@ void ChatWindow::doPresent()
{
const Beings &beings = beingManager->getAll();
std::string response = "";
- unsigned short playercount = 0;
- char cpc[25];
+ int playercount = 0;
+
for (Beings::const_iterator bi = beings.begin(), be = beings.end();
bi != be; ++bi)
{
@@ -324,7 +324,9 @@ void ChatWindow::doPresent()
++playercount;
}
}
- sprintf(cpc,"%u players are present.",playercount);
+
+ std::string cpc = strprintf(_("%d players are present."), playercount);
+
if (mRecorder->isRecording())
{
// Get the current system time
@@ -339,7 +341,6 @@ void ChatWindow::doPresent()
<< (int) ((t / 60) % 60)
<< "] ";
-
mRecorder->record(timeStr.str() + _("Present: ") + response + _("; ") + cpc);
getFocused()->chatLog(_("Attendance written to record log."),
BY_SERVER, true);
diff --git a/src/gui/chat.h b/src/gui/chat.h
index 88dabb89..e4865ed8 100644
--- a/src/gui/chat.h
+++ b/src/gui/chat.h
@@ -186,7 +186,7 @@ class ChatWindow : public Window,
/** Add the tab to the window */
void addTab(ChatTab *tab);
- void removeWhisper(std::string nick);
+ void removeWhisper(const std::string &nick);
void adjustTabSize();