Skip to content
Permalink
Browse files

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
  • Loading branch information...
nerzhul committed Jul 25, 2017
1 parent 4a4eba7 commit 31b84ce1f2c4f9c6264f32427c3e7be1215360f1
Showing with 25 additions and 25 deletions.
  1. +25 −0 src/emerge.cpp
  2. +0 −25 src/server.h
@@ -85,6 +85,31 @@ class EmergeThread : public Thread {
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
////
@@ -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;

0 comments on commit 31b84ce

Please sign in to comment.
You can’t perform that action at this time.