diff options
author | Perttu Ahola <celeron55@gmail.com> | 2011-04-29 00:29:34 +0300 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2011-04-29 00:29:34 +0300 |
commit | 288822e73dba2fbb7f7f1c54eb5c3f516733901e (patch) | |
tree | d604e1c267b8a2bd3bd27adf46597f33c4b72355 /src/server.cpp | |
parent | 8377b5f2a6f310d6b7bcd96223b424b87392102c (diff) | |
download | minetest-288822e73dba2fbb7f7f1c54eb5c3f516733901e.tar.gz minetest-288822e73dba2fbb7f7f1c54eb5c3f516733901e.tar.bz2 minetest-288822e73dba2fbb7f7f1c54eb5c3f516733901e.zip |
Maybe fixed the flood of "WARNING: StaticObjectList::remove(): id=13 not found" style debug messages on the server when a player has quit.
Diffstat (limited to 'src/server.cpp')
-rw-r--r-- | src/server.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/server.cpp b/src/server.cpp index 322af2012..e899443f4 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -4266,6 +4266,23 @@ void Server::handlePeerChange(PeerChange &c) // The client should exist assert(n != NULL); + /* + Mark objects to be not known by the client + */ + RemoteClient *client = n->getValue(); + // Handle objects + for(core::map<u16, bool>::Iterator + i = client->m_known_objects.getIterator(); + i.atEnd()==false; i++) + { + // Get object + u16 id = i.getNode()->getKey(); + ServerActiveObject* obj = m_env.getActiveObject(id); + + if(obj && obj->m_known_by_count > 0) + obj->m_known_by_count--; + } + // Collect information about leaving in chat std::wstring message; { |