chatlib: do not send chat messages to controlled bots

graph: first try more memory friendly bsp size check
build: restore ssse3 & ssse3 instructions (use nosmid version if needed)
Co-Authored-By: Max <161382234+dyspose@users.noreply.github.com>
This commit is contained in:
jeefo 2025-02-28 00:39:52 +03:00
commit 855fb903b6
No known key found for this signature in database
GPG key ID: D696786B81B667C8
13 changed files with 76 additions and 41 deletions

View file

@ -410,6 +410,11 @@ void Bot::sendToChatLegacy (StringRef message, bool teamOnly) {
bool dedicatedSend = false;
auto sendChatMsg = [&] (const Client &client, String chatMsg) {
if (game.isDedicated () && !dedicatedSend) {
dedicatedSend = true;
game.print ("%s", chatMsg.trim ());
}
auto rcv = bots[client.ent];
if (rcv != nullptr) {
@ -418,6 +423,9 @@ void Bot::sendToChatLegacy (StringRef message, bool teamOnly) {
rcv->m_sayTextBuffer.sayText = message;
rcv->m_sayTextBuffer.timeNextChat = game.time () + rcv->m_sayTextBuffer.chatDelay;
}
else {
return; // do not send to controlled bots
}
if (((client.flags & ClientFlags::Alive) && m_isAlive)
|| (!(client.flags & ClientFlags::Alive) && m_isAlive)
@ -427,11 +435,6 @@ void Bot::sendToChatLegacy (StringRef message, bool teamOnly) {
.writeByte (m_index)
.writeString (chatMsg.chars ());
}
if (game.isDedicated () && !dedicatedSend) {
game.print ("%s", chatMsg.trim ());
}
dedicatedSend = true;
};
if (teamOnly) {