mirror of
https://github.com/minetest/minetest.git
synced 2025-06-28 22:26:04 +02:00
Fix MeshGrid::isMeshPos()
`(1 + 1 + 0) % 2 = 0`, for example, so it had false positives. Only minimap generation uses this function. It did useless work.
This commit is contained in:
@ -179,7 +179,9 @@ struct MeshGrid {
|
|||||||
/// @brief Returns true if p is an origin of a cell in the grid.
|
/// @brief Returns true if p is an origin of a cell in the grid.
|
||||||
bool isMeshPos(v3s16 &p) const
|
bool isMeshPos(v3s16 &p) const
|
||||||
{
|
{
|
||||||
return ((p.X + p.Y + p.Z) % cell_size) == 0;
|
return p.X % cell_size == 0
|
||||||
|
&& p.Y % cell_size == 0
|
||||||
|
&& p.Z % cell_size == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @brief Returns index of the given offset in a grid cell
|
/// @brief Returns index of the given offset in a grid cell
|
||||||
|
Reference in New Issue
Block a user