mirror of
https://github.com/liyunfan1223/mod-playerbots.git
synced 2026-02-20 18:10:02 +01:00
Fix crash when bot unable to find valid reply.
This commit is contained in:
parent
d33a28954f
commit
0b599de6bd
@ -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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user