From: Perttu Ahola Date: Fri, 25 Nov 2011 13:19:42 +0000 (+0200) Subject: Set block modified flag when node metadata inventory is modified X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=704d8a62bf4c52c5ac0d9a85b0b902ea833a7e90;p=zefram%2Fminetest%2Fminetest_engine.git Set block modified flag when node metadata inventory is modified --- diff --git a/src/server.cpp b/src/server.cpp index dd4a93c7..cd67bc74 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -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::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; }