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);