mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Fix object position border checking
Borders have to be converted into BS format in order to be accurately comparable to object positions.
This commit is contained in:
parent
f61f817b9c
commit
6c81be51ff
2 changed files with 11 additions and 9 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue