Skip to content

Commit

Permalink
Checking msg is not empty to avoid empties broadcasts.
Browse files Browse the repository at this point in the history
  • Loading branch information
elsongabriel committed Apr 9, 2024
1 parent f865793 commit 6fa2421
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/game/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}

Expand Down

0 comments on commit 6fa2421

Please sign in to comment.