MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / HaveChatMessages

Function HaveChatMessages

src/network/network_chat_gui.cpp:67–77  ·  view source on GitHub ↗

* Test if there are any chat messages to display. * @param show_all Set if all messages should be included, instead of unexpired only. * @return True iff there are chat messages to display. */

Source from the content-addressed store, hash-verified

65 * @return True iff there are chat messages to display.
66 */
67static inline bool HaveChatMessages(bool show_all)
68{
69 if (show_all) return !_chatmsg_list.empty();
70
71 auto now = std::chrono::steady_clock::now();
72 for (auto &cmsg : _chatmsg_list) {
73 if (cmsg.remove_time >= now) return true;
74 }
75
76 return false;
77}
78
79/**
80 * Add a text message to the 'chat window' to be shown

Callers 1

NetworkDrawChatMessageFunction · 0.85

Calls 2

nowClass · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected