Skip to content

Commit

Permalink
Map generation limit: Cache as 'const' not 'const static'
Browse files Browse the repository at this point in the history
  • Loading branch information
paramat committed Jan 8, 2017
1 parent ddcf842 commit 8c1b4f2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/map.cpp
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/mapblock.h
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 8c1b4f2

Please sign in to comment.