Fix NetworkAddChatMessage when MAX_CHAT_MESSAGES is 0

This commit is contained in:
Jonathan G Rennison
2023-06-16 01:21:38 +01:00
parent 3d2dc77aa2
commit 7af34aaadd
2 changed files with 4 additions and 2 deletions

View File

@@ -88,8 +88,10 @@ static inline bool HaveChatMessages(bool show_all)
* @param duration The duration of the chat message in seconds
* @param message message itself in printf() style
*/
void CDECL NetworkAddChatMessage(TextColour colour, uint duration, const std::string &message)
void NetworkAddChatMessage(TextColour colour, uint duration, const std::string_view message)
{
if (MAX_CHAT_MESSAGES == 0) return;
if (_chatmsg_list.size() == MAX_CHAT_MESSAGES) {
_chatmsg_list.pop_back();
}

View File

@@ -94,7 +94,7 @@ uint NetworkServerKickOrBanIP(const std::string &ip, bool ban, const std::string
void NetworkInitChatMessage();
void NetworkReInitChatBoxSize();
void CDECL NetworkAddChatMessage(TextColour colour, uint duration, const std::string &message);
void NetworkAddChatMessage(TextColour colour, uint duration, const std::string_view message);
void NetworkUndrawChatMessage();
void NetworkChatMessageLoop();