Strip newline on messages directly, rather than when appending.

This commit is contained in:
Mari the Deer 2022-11-06 16:24:25 +01:00
commit aa8e152e0f
2 changed files with 6 additions and 4 deletions

View file

@ -859,12 +859,14 @@ Class SWWMStatusBar : BaseStatusBar
{
// ignore outside of levels
if ( gamestate != GS_LEVEL ) return false;
// strip trailing newline (all Printf type messages have this)
outline.DeleteLastCharacter();
// append chat messages to full history
if ( (printlevel == PRINT_CHAT) || (printlevel == PRINT_TEAMCHAT) )
EventHandler.SendNetworkEvent("swwmstoremessage."..outline.Left(outline.Length()-1),level.totaltime,printlevel,consoleplayer);
EventHandler.SendNetworkEvent("swwmstoremessage."..outline,level.totaltime,printlevel,consoleplayer);
if ( (printlevel < PRINT_LOW) || (printlevel > PRINT_TEAMCHAT) ) return true; // we couldn't care less about these
let m = new("MsgLine");
m.str = outline.Left(outline.Length()-1); // strip newline
m.str = outline;
m.type = printlevel;
m.tic = level.totaltime;
m.rep = 1;