Move MapEditEventAreaIgnorer to emerge.cpp
authorLoic Blot <loic.blot@unix-experience.fr>
Tue, 25 Jul 2017 06:39:42 +0000 (08:39 +0200)
committerLoic Blot <loic.blot@unix-experience.fr>
Tue, 25 Jul 2017 06:47:52 +0000 (08:47 +0200)
It's only used in emerge threads and it's a local object, don't expose it to the whole Minetest

src/emerge.cpp
src/server.h

index f5852aaae7de09c640cf7cdc8bd3a57f84d4c387..0fc31e9e168e5927a359f2aab4bec340eecbda47 100644 (file)
@@ -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
 ////
index fff7f9b6a551ce29996c5fd01e659de8ca0269bb..ac7ba4f619a817bd7091d129a91f3400a72cdf76 100644 (file)
@@ -65,31 +65,6 @@ enum ClientDeletionReason {
        CDR_DENY
 };
 
-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;
-};
-
 struct MediaInfo
 {
        std::string path;