diff options
author | paramat <mat.gregory@virginmedia.com> | 2017-01-07 21:24:31 +0000 |
---|---|---|
committer | paramat <mat.gregory@virginmedia.com> | 2017-01-08 21:18:11 +0000 |
commit | 8c1b4f298e2812598b0350e8c86b6a0788062ed7 (patch) | |
tree | 87d5385b801da40ebde5e64136b7e5362c0f1090 /src | |
parent | ddcf8422a229c4965233177f6315847a6773a20c (diff) | |
download | minetest-8c1b4f298e2812598b0350e8c86b6a0788062ed7.tar.gz minetest-8c1b4f298e2812598b0350e8c86b6a0788062ed7.tar.bz2 minetest-8c1b4f298e2812598b0350e8c86b6a0788062ed7.zip |
Map generation limit: Cache as 'const' not 'const static'
Diffstat (limited to 'src')
-rw-r--r-- | src/map.cpp | 2 | ||||
-rw-r--r-- | src/mapblock.h | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/map.cpp b/src/map.cpp index d4115887f..0659f66aa 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -2078,7 +2078,7 @@ ServerMapSector *ServerMap::createSector(v2s16 p2d) Block minimum nodepos = blockpos * mapblocksize. Block maximum nodepos = (blockpos + 1) * mapblocksize - 1. */ - const static u16 map_gen_limit = MYMIN(MAX_MAP_GENERATION_LIMIT, + const u16 map_gen_limit = MYMIN(MAX_MAP_GENERATION_LIMIT, g_settings->getU16("map_generation_limit")); if (p2d.X * MAP_BLOCKSIZE < -map_gen_limit || (p2d.X + 1) * MAP_BLOCKSIZE - 1 > map_gen_limit diff --git a/src/mapblock.h b/src/mapblock.h index d46b7b880..f80800109 100644 --- a/src/mapblock.h +++ b/src/mapblock.h @@ -653,7 +653,7 @@ typedef std::vector<MapBlock*> MapBlockVect; inline bool objectpos_over_limit(v3f p) { - const static float map_gen_limit_bs = MYMIN(MAX_MAP_GENERATION_LIMIT, + const float map_gen_limit_bs = MYMIN(MAX_MAP_GENERATION_LIMIT, g_settings->getU16("map_generation_limit")) * BS; return (p.X < -map_gen_limit_bs || p.X > map_gen_limit_bs @@ -676,7 +676,7 @@ inline bool objectpos_over_limit(v3f p) */ inline bool blockpos_over_limit(v3s16 p) { - const static u16 map_gen_limit = MYMIN(MAX_MAP_GENERATION_LIMIT, + const u16 map_gen_limit = MYMIN(MAX_MAP_GENERATION_LIMIT, g_settings->getU16("map_generation_limit")); return (p.X * MAP_BLOCKSIZE < -map_gen_limit || (p.X + 1) * MAP_BLOCKSIZE - 1 > map_gen_limit |