fix: always translate menus as they always has destination player (#225)

This commit is contained in:
dmitry 2021-09-10 20:12:23 +03:00
commit bea8120a41
No known key found for this signature in database
GPG key ID: 8297CE728B7A7E37

View file

@ -1690,6 +1690,8 @@ void BotControl::showMenu (int id) {
// make menus looks like we need only once
if (!menusParsed) {
m_ignoreTranslate = false; // always translate menus
for (auto &parsed : m_menus) {
StringRef translated = conf.translate (parsed.text);
@ -1711,7 +1713,6 @@ void BotControl::showMenu (int id) {
}
auto &client = util.getClient (game.indexOfPlayer (m_ent));
auto sendMenu = [&](int32 slots, bool last, StringRef text) {
MessageWriter (MSG_ONE, msgs.id (NetMsg::ShowMenu), nullptr, m_ent)
.writeShort (slots)