mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
Fix crash
This commit is contained in:
@@ -545,7 +545,7 @@ void PlayerbotHolder::OnBotLogin(Player* const bot)
|
||||
if (isLfg)
|
||||
{
|
||||
std::string lfgChannelName = channel->pattern[sWorld->GetDefaultDbcLocale()];
|
||||
new_channel = cMgr->GetJoinChannel(lfgChannelName, channel->ChannelID);
|
||||
new_channel = cMgr->GetJoinChannel("LookingForGroup", channel->ChannelID);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -192,7 +192,6 @@ uint32 PlayerbotTextMgr::GetLocalePriority()
|
||||
topLocale = i;
|
||||
}
|
||||
|
||||
LOG_INFO("playerbots", "GetLocalePriority: {}", topLocale);
|
||||
return topLocale;
|
||||
}
|
||||
|
||||
|
||||
@@ -661,15 +661,16 @@ void ChatReplyAction::ChatReplyDo(Player* bot, uint32 type, uint32 guid1, uint32
|
||||
LOG_ERROR("playerbots", "plr pointer is nullptr chat whisper");
|
||||
}
|
||||
|
||||
if (type == CHAT_MSG_SAY)
|
||||
else if (type == CHAT_MSG_SAY)
|
||||
{
|
||||
LOG_INFO("playerbots", "say respond: {}", respondsText);
|
||||
if (bot->GetTeamId() == TEAM_ALLIANCE)
|
||||
bot->Say(respondsText, LANG_COMMON);
|
||||
else
|
||||
bot->Say(respondsText, LANG_ORCISH);
|
||||
}
|
||||
|
||||
if (type == CHAT_MSG_YELL)
|
||||
else if (type == CHAT_MSG_YELL)
|
||||
{
|
||||
if (bot->GetTeamId() == TEAM_ALLIANCE)
|
||||
bot->Yell(respondsText, LANG_COMMON);
|
||||
@@ -677,7 +678,7 @@ void ChatReplyAction::ChatReplyDo(Player* bot, uint32 type, uint32 guid1, uint32
|
||||
bot->Yell(respondsText, LANG_ORCISH);
|
||||
}
|
||||
|
||||
if (type == CHAT_MSG_GUILD)
|
||||
else if (type == CHAT_MSG_GUILD)
|
||||
{
|
||||
if (!bot->GetGuildId())
|
||||
return;
|
||||
|
||||
@@ -109,7 +109,7 @@ void SuggestWhatToDoAction::instance()
|
||||
instances["Halls of Reflection"] = 80;
|
||||
}
|
||||
|
||||
std::vector<std::string_view> allowedInstances;
|
||||
std::vector<std::string> allowedInstances;
|
||||
for (const auto& instance : instances)
|
||||
{
|
||||
if (bot->GetLevel() >= instance.second)
|
||||
@@ -248,12 +248,12 @@ void SuggestWhatToDoAction::grindReputation()
|
||||
factions["The Wyrmrest Accord"] = 77;
|
||||
}
|
||||
|
||||
std::vector<std::string_view> levels;
|
||||
std::vector<std::string> levels;
|
||||
levels.push_back("honored");
|
||||
levels.push_back("revered");
|
||||
levels.push_back("exalted");
|
||||
|
||||
std::vector<std::string_view> allowedFactions;
|
||||
std::vector<std::string> allowedFactions;
|
||||
for (const auto& i : factions)
|
||||
{
|
||||
if (bot->GetLevel() >= i.second)
|
||||
@@ -310,7 +310,10 @@ void SuggestWhatToDoAction::spam(std::string msg, uint8 flags, bool worldChat, b
|
||||
ChatChannelsEntry const* channel = sChatChannelsStore.LookupEntry(i);
|
||||
if (!channel) continue;
|
||||
|
||||
LOG_INFO("playerbots", "Loop on channel: {}", channel->pattern[_dbc_locale]);
|
||||
if (channel->pattern[_dbc_locale])
|
||||
LOG_INFO("playerbots", "Loop on channel: {}", channel->pattern[_dbc_locale]);
|
||||
else
|
||||
LOG_ERROR("playerbots", "channel->pattern[_dbc_locale] is null");
|
||||
|
||||
for (AreaTableEntry const* current_zone : sAreaTableStore)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user