Skip to content

Commit 8c1b4f2

Browse files
committedJan 8, 2017
Map generation limit: Cache as 'const' not 'const static'
1 parent ddcf842 commit 8c1b4f2

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed
 

‎src/map.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -2078,7 +2078,7 @@ ServerMapSector *ServerMap::createSector(v2s16 p2d)
20782078
Block minimum nodepos = blockpos * mapblocksize.
20792079
Block maximum nodepos = (blockpos + 1) * mapblocksize - 1.
20802080
*/
2081-
const static u16 map_gen_limit = MYMIN(MAX_MAP_GENERATION_LIMIT,
2081+
const u16 map_gen_limit = MYMIN(MAX_MAP_GENERATION_LIMIT,
20822082
g_settings->getU16("map_generation_limit"));
20832083
if (p2d.X * MAP_BLOCKSIZE < -map_gen_limit
20842084
|| (p2d.X + 1) * MAP_BLOCKSIZE - 1 > map_gen_limit

‎src/mapblock.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,7 @@ typedef std::vector<MapBlock*> MapBlockVect;
653653

654654
inline bool objectpos_over_limit(v3f p)
655655
{
656-
const static float map_gen_limit_bs = MYMIN(MAX_MAP_GENERATION_LIMIT,
656+
const float map_gen_limit_bs = MYMIN(MAX_MAP_GENERATION_LIMIT,
657657
g_settings->getU16("map_generation_limit")) * BS;
658658
return (p.X < -map_gen_limit_bs
659659
|| p.X > map_gen_limit_bs
@@ -676,7 +676,7 @@ inline bool objectpos_over_limit(v3f p)
676676
*/
677677
inline bool blockpos_over_limit(v3s16 p)
678678
{
679-
const static u16 map_gen_limit = MYMIN(MAX_MAP_GENERATION_LIMIT,
679+
const u16 map_gen_limit = MYMIN(MAX_MAP_GENERATION_LIMIT,
680680
g_settings->getU16("map_generation_limit"));
681681
return (p.X * MAP_BLOCKSIZE < -map_gen_limit
682682
|| (p.X + 1) * MAP_BLOCKSIZE - 1 > map_gen_limit

0 commit comments

Comments
 (0)