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 22, 2024
1 parent 28a7c90 commit 482f4bf
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 @@ -8,6 +8,7 @@
#include "SlashCommandHandler.h"

#include <iomanip>
#include <ranges>

#include "DEVGMCommands.h"
#include "GMGreaterThanZeroCommands.h"
Expand Down Expand Up @@ -118,8 +119,8 @@ void GMZeroCommands::Help(Entity* entity, const SystemAddress& sysAddr, const st
return;
}

auto it = std::find_if(CommandInfos.begin(), CommandInfos.end(), [&trimmedArgs](const auto& pair) {
return pair.first == trimmedArgs || std::find(pair.second.aliases.begin(), pair.second.aliases.end(), trimmedArgs) != pair.second.aliases.end();
auto it = std::ranges::find_if(CommandInfos, [&trimmedArgs](const auto& pair) {
return std::ranges::find(pair.second.aliases, trimmedArgs) != pair.second.aliases.end();
});

if (it != CommandInfos.end() && entity->GetGMLevel() >= it->second.requiredLevel) {
Expand Down

0 comments on commit 482f4bf

Please sign in to comment.