Skip to content

Commit

Permalink
Merge branch 'i-know-what-time-it-is' into 'master'
Browse files Browse the repository at this point in the history
Fix(Log): Don't Put Timestamps Mid-Message

Closes #6982

See merge request OpenMW/openmw!3593
  • Loading branch information
Zackhasacat committed Nov 21, 2023
2 parents abd2c53 + 5cc1b11 commit f3770a2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion apps/openmw/mwgui/debugwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ namespace MWGui
static std::mutex sBufferMutex;
static int64_t sLogStartIndex;
static int64_t sLogEndIndex;
static bool hasPrefix = false;

void DebugWindow::startLogRecording()
{
Expand Down Expand Up @@ -170,11 +171,17 @@ namespace MWGui
addChar(c);
if (c == '#')
addChar(c);
if (c == '\n')
hasPrefix = false;
}
};
for (char c : color)
addChar(c);
addShieldedStr(prefix);
if (!hasPrefix)
{
addShieldedStr(prefix);
hasPrefix = true;
}
addShieldedStr(msg);
if (bufferOverflow)
sLogStartIndex = (sLogEndIndex + 1) % bufSize;
Expand Down

0 comments on commit f3770a2

Please sign in to comment.