aboutsummaryrefslogtreecommitdiff
path: root/src/content_abm.cpp
diff options
context:
space:
mode:
authorIlya Zhuravlev <zhuravlevilya@ya.ru>2012-12-20 21:19:49 +0400
committerkwolekr <kwolekr@minetest.net>2013-03-11 19:08:39 -0400
commit6a1670dbc31cc0e44178bbd9ad34ff0d5981a060 (patch)
treece32cd4be20e9be30367f2ad25d9dae6a0482898 /src/content_abm.cpp
parente204bedf1d781e43b8caa334a99319efc5b7ce46 (diff)
downloadminetest-6a1670dbc31cc0e44178bbd9ad34ff0d5981a060.tar.gz
minetest-6a1670dbc31cc0e44178bbd9ad34ff0d5981a060.tar.bz2
minetest-6a1670dbc31cc0e44178bbd9ad34ff0d5981a060.zip
Migrate to STL containers/algorithms.
Diffstat (limited to 'src/content_abm.cpp')
-rw-r--r--src/content_abm.cpp21
1 files changed, 8 insertions, 13 deletions
diff --git a/src/content_abm.cpp b/src/content_abm.cpp
index 03fc82ed4..a88450095 100644
--- a/src/content_abm.cpp
+++ b/src/content_abm.cpp
@@ -114,7 +114,7 @@ public:
actionstream<<"A sapling grows into a tree at "
<<PP(p)<<std::endl;
- core::map<v3s16, MapBlock*> modified_blocks;
+ std::map<v3s16, MapBlock*> modified_blocks;
v3s16 tree_p = p;
ManualMapVoxelManipulator vmanip(map);
v3s16 tree_blockp = getNodeBlockPos(tree_p);
@@ -124,24 +124,19 @@ public:
vmanip.blitBackAll(&modified_blocks);
// update lighting
- core::map<v3s16, MapBlock*> lighting_modified_blocks;
- for(core::map<v3s16, MapBlock*>::Iterator
- i = modified_blocks.getIterator();
- i.atEnd() == false; i++)
- {
- lighting_modified_blocks.insert(i.getNode()->getKey(), i.getNode()->getValue());
- }
+ std::map<v3s16, MapBlock*> lighting_modified_blocks;
+ lighting_modified_blocks.insert(modified_blocks.begin(), modified_blocks.end());
map->updateLighting(lighting_modified_blocks, modified_blocks);
// Send a MEET_OTHER event
MapEditEvent event;
event.type = MEET_OTHER;
- for(core::map<v3s16, MapBlock*>::Iterator
- i = modified_blocks.getIterator();
- i.atEnd() == false; i++)
+// event.modified_blocks.insert(modified_blocks.begin(), modified_blocks.end());
+ for(std::map<v3s16, MapBlock*>::iterator
+ i = modified_blocks.begin();
+ i != modified_blocks.end(); ++i)
{
- v3s16 p = i.getNode()->getKey();
- event.modified_blocks.insert(p, true);
+ event.modified_blocks.insert(i->first);
}
map->dispatchEvent(&event);
}