summaryrefslogtreecommitdiff
path: root/src/mapblock.h
diff options
context:
space:
mode:
authorest31 <MTest31@outlook.com>2015-09-16 16:12:59 +0200
committerest31 <MTest31@outlook.com>2015-09-16 17:39:49 +0200
commit6c81be51ffd26ec7dee1ecb887a8743a8b6a6ce4 (patch)
tree68d6f4cebb178a3288078ff6f394bbc2d7a42091 /src/mapblock.h
parentf61f817b9c170942a5b3ce3591125c2191645cd0 (diff)
downloadminetest-6c81be51ffd26ec7dee1ecb887a8743a8b6a6ce4.tar.gz
minetest-6c81be51ffd26ec7dee1ecb887a8743a8b6a6ce4.tar.bz2
minetest-6c81be51ffd26ec7dee1ecb887a8743a8b6a6ce4.zip
Fix object position border checking
Borders have to be converted into BS format in order to be accurately comparable to object positions.
Diffstat (limited to 'src/mapblock.h')
-rw-r--r--src/mapblock.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/mapblock.h b/src/mapblock.h
index b2d5f98fa..73c17ee60 100644
--- a/src/mapblock.h
+++ b/src/mapblock.h
@@ -639,14 +639,14 @@ typedef std::vector<MapBlock*> MapBlockVect;
inline bool objectpos_over_limit(v3f p)
{
- const static u16 map_gen_limit = MYMIN(MAX_MAP_GENERATION_LIMIT,
- g_settings->getU16("map_generation_limit"));
- return (p.X < -map_gen_limit
- || p.X > map_gen_limit
- || p.Y < -map_gen_limit
- || p.Y > map_gen_limit
- || p.Z < -map_gen_limit
- || p.Z > map_gen_limit);
+ const static 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
+ || p.Y < -map_gen_limit_bs
+ || p.Y > map_gen_limit_bs
+ || p.Z < -map_gen_limit_bs
+ || p.Z > map_gen_limit_bs);
}
inline bool blockpos_over_limit(v3s16 p)