mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-12-01 21:12:50 +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);
|
proper_list.push_back(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (proper_list.empty())
|
||||||
|
return "";
|
||||||
|
|
||||||
BotTextEntry textEntry = proper_list[urand(0, proper_list.size() - 1)];
|
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];
|
std::string botText = !textEntry.m_text[GetLocalePriority()].empty() ? textEntry.m_text[GetLocalePriority()] : textEntry.m_text[0];
|
||||||
for (auto & placeholder : placeholders)
|
for (auto & placeholder : placeholders)
|
||||||
|
|||||||
Reference in New Issue
Block a user