Refactoring bot chat and sayaction caused by group crash <NOT FINISHED>

This commit is contained in:
Atidot3
2024-07-31 22:39:59 +02:00
parent f96f909b6e
commit 79d0f3fd28
10 changed files with 482 additions and 208 deletions

View File

@@ -281,8 +281,6 @@ void SuggestWhatToDoAction::spam(std::string msg, uint8 flags, bool worldChat, b
}
else
{
if (!bot->IsInChannel(chn))
chn->JoinChannel(bot, "");
chn->Say(bot->GetGUID(), msg.c_str(), LANG_UNIVERSAL);
}
@@ -291,9 +289,6 @@ void SuggestWhatToDoAction::spam(std::string msg, uint8 flags, bool worldChat, b
std::string randomName = channelNames[urand(0, channelNames.size() - 1)];
if (Channel* chn = cMgr->GetChannel(randomName, bot))
{
if (!bot->IsInChannel(chn))
chn->JoinChannel(bot, "");
chn->Say(bot->GetGUID(), msg.c_str(), LANG_UNIVERSAL);
}
}
@@ -305,11 +300,9 @@ void SuggestWhatToDoAction::spam(std::string msg, uint8 flags, bool worldChat, b
}
}
if (sPlayerbotAIConfig->randomBotGuildTalk && guild && bot->GetGuildId())
if (sPlayerbotAIConfig->randomBotGuildTalk)
{
Guild* guild = sGuildMgr->GetGuildById(bot->GetGuildId());
if (guild)
guild->BroadcastToGuild(bot->GetSession(), false, msg.c_str(), LANG_UNIVERSAL);
botAI->SayToGuild(msg);
}
}