From 133bb7353d091e4aa20283cc16ce2d3f07d85f43 Mon Sep 17 00:00:00 2001 From: Elson Costa Date: Wed, 27 Mar 2024 12:31:47 -0300 Subject: [PATCH] Checking msg is not empty to avoid empties broadcasts. --- src/game/game.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/game/game.cpp b/src/game/game.cpp index 11ed432da15..757c4f3b54f 100644 --- a/src/game/game.cpp +++ b/src/game/game.cpp @@ -7836,9 +7836,11 @@ void Game::addBestiaryList(uint16_t raceid, std::string name) { } void Game::broadcastMessage(const std::string &text, MessageClasses type) const { - g_logger().info("Broadcasted message: {}", text); - for (const auto &it : players) { - it.second->sendTextMessage(type, text); + if (!text.empty()) { + g_logger().info("Broadcasted message: {}", text); + for (const auto &it : players) { + it.second->sendTextMessage(type, text); + } } }