Fix reload command security (#774)

This commit is contained in:
SaW
2024-12-14 17:55:06 +01:00
committed by GitHub
parent c436781d39
commit 453fa4b4f5

View File

@@ -958,9 +958,17 @@ std::vector<std::string> PlayerbotHolder::HandlePlayerbotCommand(char const* arg
if (!strcmp(cmd, "reload"))
{
messages.push_back("Reloading config");
sPlayerbotAIConfig->Initialize();
return messages;
if (master->GetSession()->GetSecurity() >= SEC_GAMEMASTER)
{
sPlayerbotAIConfig->Initialize();
messages.push_back("Config reloaded.");
return messages;
}
else
{
messages.push_back("ERROR: Only GM can use this command.");
return messages;
}
}
if (!strcmp(cmd, "tweak"))