refactor: break some very long conditions

This commit is contained in:
jeefo 2024-02-16 00:57:41 +03:00
commit c662f4a08f
No known key found for this signature in database
GPG key ID: 927BCA0779BEA8ED
11 changed files with 463 additions and 91 deletions

View file

@ -348,7 +348,11 @@ void Bot::checkForChat () {
}
// bot chatting turned on?
if (rg.chance (cv_chat_percent.int_ ()) && m_lastChatTime + rg.get (6.0f, 10.0f) < game.time () && bots.getLastChatTimestamp () + rg.get (2.5f, 5.0f) < game.time () && !isReplyingToChat ()) {
if (rg.chance (cv_chat_percent.int_ ())
&& m_lastChatTime + rg.get (6.0f, 10.0f) < game.time ()
&& bots.getLastChatTimestamp () + rg.get (2.5f, 5.0f) < game.time ()
&& !isReplyingToChat ()) {
if (conf.hasChatBank (Chat::Dead)) {
StringRef phrase = conf.pickRandomFromChatBank (Chat::Dead);
bool sayBufferExists = false;