Fix NetworkAddChatMessage when MAX_CHAT_MESSAGES is 0

pull/556/head
Jonathan G Rennison 1 year ago
parent 3d2dc77aa2
commit 7af34aaadd

@ -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();
}

@ -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();

Loading…
Cancel
Save