mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-02 16:38:41 +00:00
Safely handle block deletion (#13315)
Co-authored-by: Jude Melton-Houghton <jwmhjwmh@gmail.com>
This commit is contained in:
parent
f3b198e490
commit
ed632f3854
7 changed files with 74 additions and 5 deletions
10
src/map.h
10
src/map.h
|
@ -412,8 +412,15 @@ public:
|
|||
// Database version
|
||||
void loadBlock(std::string *blob, v3s16 p3d, MapSector *sector, bool save_after_load=false);
|
||||
|
||||
// Blocks are removed from the map but not deleted from memory until
|
||||
// deleteDetachedBlocks() is called, since pointers to them may still exist
|
||||
// when deleteBlock() is called.
|
||||
bool deleteBlock(v3s16 blockpos) override;
|
||||
|
||||
void deleteDetachedBlocks();
|
||||
|
||||
void step();
|
||||
|
||||
void updateVManip(v3s16 pos);
|
||||
|
||||
// For debug printing
|
||||
|
@ -457,6 +464,9 @@ private:
|
|||
|
||||
std::set<v3s16> m_chunks_in_progress;
|
||||
|
||||
// used by deleteBlock() and deleteDetachedBlocks()
|
||||
MapBlockVect m_detached_blocks;
|
||||
|
||||
// Queued transforming water nodes
|
||||
UniqueQueue<v3s16> m_transforming_liquid;
|
||||
f32 m_transforming_liquid_loop_count_multiplier = 1.0f;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue