aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsapier <Sapier at GMX dot net>2014-02-02 01:55:24 +0100
committersapier <Sapier at GMX dot net>2014-02-02 01:55:24 +0100
commite7c2e61b19d24da14617e5689cad1a2d1ba1daec (patch)
tree236bea5fd044d60ee1e7e1ce9f1609523faeb879
parent6a3fa9df12d5982f84e83e1c61ff757edc1043f4 (diff)
downloadminetest-e7c2e61b19d24da14617e5689cad1a2d1ba1daec.tar.gz
minetest-e7c2e61b19d24da14617e5689cad1a2d1ba1daec.tar.bz2
minetest-e7c2e61b19d24da14617e5689cad1a2d1ba1daec.zip
Add additional check to avoid broadcasting private messages in error conditions
-rw-r--r--src/server.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/server.cpp b/src/server.cpp
index 5b799eb2c..5dde78e60 100644
--- a/src/server.cpp
+++ b/src/server.cpp
@@ -4385,6 +4385,10 @@ void Server::notifyPlayer(const char *name, const std::wstring msg, const bool p
Player *player = m_env->getPlayer(name);
if(!player)
return;
+
+ if (player->peer_id == PEER_ID_INEXISTENT)
+ return;
+
if (prepend)
SendChatMessage(player->peer_id, std::wstring(L"Server -!- ")+msg);
else