From 38ed2caab1d9d400ddc844567d00338c5b3759cf Mon Sep 17 00:00:00 2001 From: Indev Date: Sun, 4 Aug 2024 16:52:14 +0300 Subject: [PATCH] Fix chat not saving in console Not sure why it was working before but broke now, maybe making va use snprintf instead of sprintf broke that --- src/hu_stuff.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/hu_stuff.c b/src/hu_stuff.c index e438a1261..ae6a86135 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -461,7 +461,10 @@ void HU_AddChatText(const char *text, boolean playsound) if (OLDCHAT) // if we're using oldchat, print directly in console CONS_Printf("%s\n", text); else // if we aren't, still save the message to log.txt - CON_LogMessage(va("%s\n", text)); + { + CON_LogMessage(text); + CON_LogMessage("\n"); // Add newline. Don't use va for that, since `text` might be refering to va's buffer itself + } }