mirror of
https://github.com/minetest/minetest.git
synced 2024-12-22 22:22:23 +01: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:
parent
3441fd6e04
commit
04f0a4a1c6
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user