Skip to content

Commit

Permalink
Update SlashCommandHandler.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Tiernan-Alderman committed May 21, 2024
1 parent a7fc9bc commit ca66cab
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions dGame/dUtilities/SlashCommandHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<uint32_t> parsedPage = GeneralUtils::TryParse<uint32_t>(trimmedArgs);
if (trimmedArgs.empty() || parsedPage.has_value()) {
size_t page = parsedPage.value_or(1);
Expand Down

0 comments on commit ca66cab

Please sign in to comment.