1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Drop wide/narrow conversion functions

The only valid usecase for these is interfacing with OS APIs
that want a locale/OS-specific multibyte encoding.
But they weren't used for that anywhere, instead UTF-8 is pretty
much assumed when it comes to that.
Since these are only a potential source of bugs and do not fulfil
their purpose at all, drop them entirely.
This commit is contained in:
sfan5 2021-01-29 14:03:27 +01:00
parent 5e392cf34f
commit c834d2ab25
11 changed files with 41 additions and 143 deletions

View file

@ -1196,7 +1196,7 @@ void Client::sendChatMessage(const std::wstring &message)
if (canSendChatMessage()) {
u32 now = time(NULL);
float time_passed = now - m_last_chat_message_sent;
m_last_chat_message_sent = time(NULL);
m_last_chat_message_sent = now;
m_chat_message_allowance += time_passed * (CLIENT_CHAT_MESSAGE_LIMIT_PER_10S / 8.0f);
if (m_chat_message_allowance > CLIENT_CHAT_MESSAGE_LIMIT_PER_10S)
@ -1832,7 +1832,7 @@ void Client::makeScreenshot()
sstr << "Failed to save screenshot '" << filename << "'";
}
pushToChatQueue(new ChatMessage(CHATMESSAGE_TYPE_SYSTEM,
narrow_to_wide(sstr.str())));
utf8_to_wide(sstr.str())));
infostream << sstr.str() << std::endl;
image->drop();
}