1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Migrate to STL containers/algorithms.

This commit is contained in:
Ilya Zhuravlev 2012-12-20 21:19:49 +04:00 committed by kwolekr
parent e204bedf1d
commit 6a1670dbc3
63 changed files with 1330 additions and 1417 deletions

View file

@ -359,7 +359,7 @@ void *EmergeThread::Thread() {
*/
BlockMakeData data;
MapBlock *block = NULL;
core::map<v3s16, MapBlock *> modified_blocks;
std::map<v3s16, MapBlock *> modified_blocks;
if (getBlockOrStartGen(p, &block, &data, allow_generate)) {
{
@ -415,13 +415,13 @@ void *EmergeThread::Thread() {
JMutexAutoLock lock(m_server->m_con_mutex);
// Add the originally fetched block to the modified list
if (block)
modified_blocks.insert(p, block);
modified_blocks[p] = block;
// Set the modified blocks unsent for all the clients
for (core::map<u16, RemoteClient*>::Iterator
i = m_server->m_clients.getIterator();
i.atEnd() == false; i++) {
RemoteClient *client = i.getNode()->getValue();
for (std::map<u16, RemoteClient*>::iterator
i = m_server->m_clients.begin();
i != m_server->m_clients.end(); ++i) {
RemoteClient *client = i->second;
if (modified_blocks.size() > 0) {
// Remove block from sent history
client->SetBlocksNotSent(modified_blocks);