diff options
Diffstat (limited to 'src/mapblock.h')
-rw-r--r-- | src/mapblock.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/mapblock.h b/src/mapblock.h index b817be596..d2ffc4bb7 100644 --- a/src/mapblock.h +++ b/src/mapblock.h @@ -81,11 +81,24 @@ public: return NODECONTAINER_ID_MAPBLOCK; }*/ - Map * getParent() + Map *getParent() { return m_parent; } + // Any server-modding code can "delete" arbitrary blocks (i.e. with + // core.delete_area), which makes them orphan. Avoid using orphan blocks for + // anything. + bool isOrphan() const + { + return !m_parent; + } + + void makeOrphan() + { + m_parent = nullptr; + } + void reallocate() { for (u32 i = 0; i < nodecount; i++) |