mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
Fix crash when bot unable to find valid reply.
This commit is contained in:
@@ -118,6 +118,9 @@ std::string PlayerbotTextMgr::GetBotText(ChatReplyType replyType, std::map<std::
|
||||
proper_list.push_back(text);
|
||||
}
|
||||
|
||||
if (proper_list.empty())
|
||||
return "";
|
||||
|
||||
BotTextEntry textEntry = proper_list[urand(0, proper_list.size() - 1)];
|
||||
std::string botText = !textEntry.m_text[GetLocalePriority()].empty() ? textEntry.m_text[GetLocalePriority()] : textEntry.m_text[0];
|
||||
for (auto & placeholder : placeholders)
|
||||
|
||||
Reference in New Issue
Block a user