From e0fd87411eb5368fee47e268ae03d073293e58c3 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Wed, 16 Mar 2022 20:35:07 -0400 Subject: fixed the last word in a line being removed from signs sometimes --- src/sign.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/sign.cpp') diff --git a/src/sign.cpp b/src/sign.cpp index 7c4f43f..b9299d6 100644 --- a/src/sign.cpp +++ b/src/sign.cpp @@ -28,11 +28,16 @@ void Sign::displayMessage(std::string text) { cur = words.front(); } else if (words.size() == 1) { lines.push_back({.text = cur, .pause = true}); + cur = ""; } prev = cur; words.pop_front(); } + + if (!cur.empty()) { + lines.push_back({.text = cur, .pause = true}); + } } lines.back().pause = true; -- cgit 1.4.1