Safer handling of NONE

This commit is contained in:
Henrik Rydgård 2023-08-01 00:25:32 +02:00
parent 3563d625b9
commit a28ae79ef7
2 changed files with 6 additions and 0 deletions

View File

@ -171,6 +171,8 @@ void OnScreenDisplay::ShowLeaderboardTracker(int leaderboardTrackerID, const cha
if (show) {
// Just an update.
entry.text = trackerText ? trackerText : "";
// Bump the end-time, in case it was fading out.
entry.endTime = now + forever_s;
} else {
// Keep the current text, hide and eventually delete it.
entry.endTime = now + (double)FadeoutTime();

View File

@ -281,6 +281,10 @@ void OnScreenMessagesView::Draw(UIContext &dc) {
auto &measuredEntry = measuredEntries[i];
ScreenEdgePosition pos = typeEdges[(size_t)entry.type];
if (pos == ScreenEdgePosition::VALUE_COUNT) {
// NONE.
continue;
}
measuredEntry.align = 0;
measuredEntry.align2 = 0;