summaryrefslogtreecommitdiff
path: root/src/emerge.cpp
diff options
context:
space:
mode:
authorLoic Blot <loic.blot@unix-experience.fr>2017-07-25 08:39:42 +0200
committerLoic Blot <loic.blot@unix-experience.fr>2017-07-25 08:47:52 +0200
commit31b84ce1f2c4f9c6264f32427c3e7be1215360f1 (patch)
treef7206d06b0b69d0b05ecf93f96a3259f6fe245b9 /src/emerge.cpp
parent4a4eba7a6c513d0b86bcabdf5882e8031c8f07ac (diff)
downloadminetest-31b84ce1f2c4f9c6264f32427c3e7be1215360f1.tar.gz
minetest-31b84ce1f2c4f9c6264f32427c3e7be1215360f1.tar.bz2
minetest-31b84ce1f2c4f9c6264f32427c3e7be1215360f1.zip
Move MapEditEventAreaIgnorer to emerge.cpp
It's only used in emerge threads and it's a local object, don't expose it to the whole Minetest
Diffstat (limited to 'src/emerge.cpp')
-rw-r--r--src/emerge.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/emerge.cpp b/src/emerge.cpp
index f5852aaae..0fc31e9e1 100644
--- a/src/emerge.cpp
+++ b/src/emerge.cpp
@@ -85,6 +85,31 @@ private:
friend class EmergeManager;
};
+class MapEditEventAreaIgnorer
+{
+public:
+ MapEditEventAreaIgnorer(VoxelArea *ignorevariable, const VoxelArea &a):
+ m_ignorevariable(ignorevariable)
+ {
+ if(m_ignorevariable->getVolume() == 0)
+ *m_ignorevariable = a;
+ else
+ m_ignorevariable = NULL;
+ }
+
+ ~MapEditEventAreaIgnorer()
+ {
+ if(m_ignorevariable)
+ {
+ assert(m_ignorevariable->getVolume() != 0);
+ *m_ignorevariable = VoxelArea();
+ }
+ }
+
+private:
+ VoxelArea *m_ignorevariable;
+};
+
////
//// EmergeManager
////