From ca66cab57b140c8a8696dc2ee41ea8b0b8dd7a9a Mon Sep 17 00:00:00 2001 From: dinomking33 <38479763+TAHuntling@users.noreply.github.com> Date: Tue, 21 May 2024 18:23:18 -0500 Subject: [PATCH] Update SlashCommandHandler.cpp --- dGame/dUtilities/SlashCommandHandler.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dGame/dUtilities/SlashCommandHandler.cpp b/dGame/dUtilities/SlashCommandHandler.cpp index 7d0ba8878..1db601242 100644 --- a/dGame/dUtilities/SlashCommandHandler.cpp +++ b/dGame/dUtilities/SlashCommandHandler.cpp @@ -76,9 +76,10 @@ void GMZeroCommands::Help(Entity* entity, const SystemAddress& sysAddr, const st constexpr size_t pageSize = 10; std::string trimmedArgs = args; - trimmedArgs.erase(trimmedArgs.begin(), std::find_if_not(trimmedArgs.begin(), trimmedArgs.end(), [](unsigned char ch) { + trimmedArgs.erase(std::find_if_not(trimmedArgs.rbegin(), trimmedArgs.rend(), [](unsigned char ch) { return std::isspace(ch); - })); + }).base(), trimmedArgs.end()); + std::optional parsedPage = GeneralUtils::TryParse(trimmedArgs); if (trimmedArgs.empty() || parsedPage.has_value()) { size_t page = parsedPage.value_or(1);