diff options
author | Perttu Ahola <celeron55@gmail.com> | 2011-11-25 15:19:42 +0200 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2011-11-29 19:13:50 +0200 |
commit | 704d8a62bf4c52c5ac0d9a85b0b902ea833a7e90 (patch) | |
tree | e8561f0074ad5bd97ee823e35bba4bce44e0c80d | |
parent | 3b3ca65562375b3cfdf8919acae8c3259df05c91 (diff) | |
download | minetest-704d8a62bf4c52c5ac0d9a85b0b902ea833a7e90.tar.gz minetest-704d8a62bf4c52c5ac0d9a85b0b902ea833a7e90.tar.bz2 minetest-704d8a62bf4c52c5ac0d9a85b0b902ea833a7e90.zip |
Set block modified flag when node metadata inventory is modified
-rw-r--r-- | src/server.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/server.cpp b/src/server.cpp index dd4a93c78..cd67bc749 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<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; } |