X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Fmapblock.h;h=a86db7b70fd1115511055c9a4d9549d949910eee;hb=e92a217bd19ee0b28890a7b33e5c6d7c037354cc;hp=641a1b69b9dde01c937a89315f770661500f8733;hpb=e6380565236d6d963acf75538f1f8fec807190cc;p=minetest.git diff --git a/src/mapblock.h b/src/mapblock.h index 641a1b69b..a86db7b70 100644 --- a/src/mapblock.h +++ b/src/mapblock.h @@ -140,7 +140,7 @@ class MapBlock //// Flags //// - inline bool isDummy() + inline bool isDummy() const { return !data; } @@ -340,15 +340,6 @@ class MapBlock // is not valid on this MapBlock. bool isValidPositionParent(v3s16 p); MapNode getNodeParent(v3s16 p, bool *is_valid_position = NULL); - void setNodeParent(v3s16 p, MapNode & n); - - inline void drawbox(s16 x0, s16 y0, s16 z0, s16 w, s16 h, s16 d, MapNode node) - { - for (u16 z = 0; z < d; z++) - for (u16 y = 0; y < h; y++) - for (u16 x = 0; x < w; x++) - setNode(x0 + x, y0 + y, z0 + z, node); - } // Copies data to VoxelManipulator to getPosRelative() void copyTo(VoxelManipulator &dst); @@ -372,20 +363,6 @@ class MapBlock return m_day_night_differs; } - //// - //// Miscellaneous stuff - //// - - /* - Tries to measure ground level. - Return value: - -1 = only air - -2 = only ground - -3 = random fail - 0...MAP_BLOCKSIZE-1 = ground level - */ - s16 getGroundLevel(v2s16 p2d); - //// //// Timestamp (see m_timestamp) //// @@ -482,7 +459,7 @@ class MapBlock // These don't write or read version by itself // Set disk to true for on-disk format, false for over-the-network format // Precondition: version >= SER_FMT_VER_LOWEST_WRITE - void serialize(std::ostream &os, u8 version, bool disk, int compression_level); + void serialize(std::ostream &result, u8 version, bool disk, int compression_level); // If disk == true: In addition to doing other things, will add // unknown blocks from id-name mapping to wndef void deSerialize(std::istream &is, u8 version, bool disk); @@ -624,7 +601,7 @@ typedef std::vector MapBlockVect; inline bool objectpos_over_limit(v3f p) { - const float max_limit_bs = MAX_MAP_GENERATION_LIMIT * BS; + const float max_limit_bs = (MAX_MAP_GENERATION_LIMIT + 0.5f) * BS; return p.X < -max_limit_bs || p.X > max_limit_bs || p.Y < -max_limit_bs ||