Merge pull request #398 from liyunfan1223/fix-misc

Fix CI
This commit is contained in:
Yunfan Li
2024-07-28 12:09:03 +08:00
committed by GitHub
3 changed files with 9 additions and 24 deletions

View File

@@ -350,7 +350,7 @@ void PlayerbotAI::UpdateAIInternal([[maybe_unused]] uint32 elapsed, bool minimal
std::string const command = holder.GetCommand();
Player* owner = holder.GetOwner();
if (owner == master && !helper.ParseChatCommand(command, owner) && holder.GetType() == CHAT_MSG_WHISPER)
if (!helper.ParseChatCommand(command, owner) && holder.GetType() == CHAT_MSG_WHISPER)
{
// To prevent spam caused by WIM
if (!(command.rfind("WIM", 0) == 0) &&
@@ -625,10 +625,15 @@ void PlayerbotAI::HandleCommand(uint32 type, std::string const text, Player* fro
return;
}
if (!IsAllowedCommand(filtered) && !GetSecurity()->CheckLevelFor(PLAYERBOT_SECURITY_ALLOW_ALL, type != CHAT_MSG_WHISPER, fromPlayer))
if (!IsAllowedCommand(filtered) &&
(master != fromPlayer || !GetSecurity()->CheckLevelFor(PLAYERBOT_SECURITY_ALLOW_ALL, type != CHAT_MSG_WHISPER, fromPlayer)))
return;
if (type == CHAT_MSG_RAID_WARNING && filtered.find(bot->GetName()) != std::string::npos && filtered.find("award") == std::string::npos)
if (!IsAllowedCommand(filtered) && master != fromPlayer)
return;
if (type == CHAT_MSG_RAID_WARNING && filtered.find(bot->GetName()) != std::string::npos &&
filtered.find("award") == std::string::npos)
{
ChatCommandHolder cmd("warning", fromPlayer, type);
chatCommands.push(cmd);

View File

@@ -206,7 +206,7 @@ bool SummonAction::Teleport(Player* summoner, Player* player)
return false;
}
bool revive = sPlayerbotAIConfig->reviveBotWhenSummoned == 2 || (sPlayerbotAIConfig->reviveBotWhenSummoned == 1 && !master->IsInCombat());
bool revive = sPlayerbotAIConfig->reviveBotWhenSummoned == 2 || (sPlayerbotAIConfig->reviveBotWhenSummoned == 1 && !master->IsInCombat() && master->IsAlive());
if (bot->isDead() && revive)
{
bot->ResurrectPlayer(1.0f, false);