Set block modified flag when node metadata inventory is modified
authorPerttu Ahola <celeron55@gmail.com>
Fri, 25 Nov 2011 13:19:42 +0000 (15:19 +0200)
committerPerttu Ahola <celeron55@gmail.com>
Tue, 29 Nov 2011 17:13:50 +0000 (19:13 +0200)
src/server.cpp

index dd4a93c78fb6c2c09e86213235f94dcbef6159a5..cd67bc7494c814ac8ee336a84f40ad9fcde8b7ac 100644 (file)
@@ -3535,14 +3535,12 @@ void Server::inventoryModified(InventoryContext *c, std::string id)
                NodeMetadata *meta = m_env->getMap().getNodeMetadata(p);
                if(meta)
                        meta->inventoryModified();
-
-               for(core::map<u16, RemoteClient*>::Iterator
-                       i = m_clients.getIterator();
-                       i.atEnd()==false; i++)
-               {
-                       RemoteClient *client = i.getNode()->getValue();
-                       client->SetBlockNotSent(blockpos);
-               }
+               
+               MapBlock *block = m_env.getMap().getBlockNoCreateNoEx(blockpos);
+               if(block)
+                       block->raiseModified(MOD_STATE_WRITE_NEEDED);
+               
+               setBlockNotSent(blockpos);
 
                return;
        }