X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Fmap.h;h=93ab591a3c0184428a29a80c614d226ae1db7b75;hb=fd3afbced5410639325e730d5710b8b5039b320e;hp=c3a1c1897dbc35d5594b140b888678c7aa12006b;hpb=9d412dd0754ce9eadf0f6122437d66d1dbfbf35c;p=minetest.git diff --git a/src/map.h b/src/map.h index c3a1c1897..93ab591a3 100644 --- a/src/map.h +++ b/src/map.h @@ -17,8 +17,7 @@ with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef MAP_HEADER -#define MAP_HEADER +#pragma once #include #include @@ -34,6 +33,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "util/container.h" #include "nodetimer.h" #include "map_settings_manager.h" +#include "debug.h" class Settings; class MapDatabase; @@ -78,7 +78,7 @@ struct MapEditEvent std::set modified_blocks; u16 already_known_by_peer = 0; - MapEditEvent() {} + MapEditEvent() = default; MapEditEvent * clone() { @@ -108,11 +108,7 @@ struct MapEditEvent case MEET_OTHER: { VoxelArea a; - for(std::set::iterator - i = modified_blocks.begin(); - i != modified_blocks.end(); ++i) - { - v3s16 p = *i; + for (v3s16 p : modified_blocks) { v3s16 np1 = p*MAP_BLOCKSIZE; v3s16 np2 = np1 + v3s16(1,1,1)*MAP_BLOCKSIZE - v3s16(1,1,1); a.addPoint(np1); @@ -217,8 +213,8 @@ class Map /*: public NodeContainer*/ bool removeNodeWithEvent(v3s16 p); // Call these before and after saving of many blocks - virtual void beginSave() { return; } - virtual void endSave() { return; } + virtual void beginSave() {} + virtual void endSave() {} virtual void save(ModifiedState save_level) { FATAL_ERROR("FIXME"); } @@ -525,5 +521,3 @@ class MMVManip : public VoxelManipulator */ std::map m_loaded_blocks; }; - -#endif