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 Mar 27, 2024
1 parent 5750e6a commit 133bb73
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 133bb73

Please sign in to comment.