]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/map.h
Replace std::list by std::vector into ServerMap::listAllLoadableBlocks ServerMap...
[dragonfireclient.git] / src / map.h
index 4e3f09a21b4b3b5f28f8aa089f0f95898411208c..e2736d560ecaf12ff29c804dfd1c7fa10be0fbc8 100644 (file)
--- a/src/map.h
+++ b/src/map.h
@@ -80,9 +80,9 @@ struct MapEditEvent
 
        MapEditEvent():
                type(MEET_OTHER),
+               n(CONTENT_AIR),
                already_known_by_peer(0)
-       {
-       }
+       { }
 
        MapEditEvent * clone()
        {
@@ -267,9 +267,10 @@ class Map /*: public NodeContainer*/
 
        virtual void save(ModifiedState save_level){assert(0);};
 
-       // Server implements this.
-       // Client leaves it as no-op.
+       // Server implements these.
+       // Client leaves them as no-op.
        virtual bool saveBlock(MapBlock *block) { return false; };
+       virtual bool deleteBlock(v3s16 blockpos) { return false; };
 
        /*
                Updates usage timers and unloads unused blocks and sectors.
@@ -423,7 +424,7 @@ class ServerMap : public Map
                - Create blank filled with CONTENT_IGNORE
 
        */
-       MapBlock * emergeBlock(v3s16 p, bool create_blank=true);
+       MapBlock *emergeBlock(v3s16 p, bool create_blank=true);
 
        /*
                Try to get a block.
@@ -465,8 +466,8 @@ class ServerMap : public Map
        void endSave();
 
        void save(ModifiedState save_level);
-       void listAllLoadableBlocks(std::list<v3s16> &dst);
-       void listAllLoadedBlocks(std::list<v3s16> &dst);
+       void listAllLoadableBlocks(std::vector<v3s16> &dst);
+       void listAllLoadedBlocks(std::vector<v3s16> &dst);
        // Saves map seed and possibly other stuff
        void saveMapMeta();
        void loadMapMeta();
@@ -498,6 +499,8 @@ class ServerMap : public Map
        // Database version
        void loadBlock(std::string *blob, v3s16 p3d, MapSector *sector, bool save_after_load=false);
 
+       bool deleteBlock(v3s16 blockpos);
+
        void updateVManip(v3s16 pos);
 
        // For debug printing