mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-02 16:38:41 +00:00
Abort raycasts that go out-of-bounds (#12006)
This commit is contained in:
parent
a0e4b2bf54
commit
b66477c29f
1 changed files with 6 additions and 0 deletions
|
@ -169,6 +169,12 @@ void Environment::continueRaycast(RaycastState *state, PointedThing *result)
|
||||||
new_nodes.MaxEdge.Z = new_nodes.MinEdge.Z;
|
new_nodes.MaxEdge.Z = new_nodes.MinEdge.Z;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (new_nodes.MaxEdge.X == S16_MAX ||
|
||||||
|
new_nodes.MaxEdge.Y == S16_MAX ||
|
||||||
|
new_nodes.MaxEdge.Z == S16_MAX) {
|
||||||
|
break; // About to go out of bounds
|
||||||
|
}
|
||||||
|
|
||||||
// For each untested node
|
// For each untested node
|
||||||
for (s16 x = new_nodes.MinEdge.X; x <= new_nodes.MaxEdge.X; x++)
|
for (s16 x = new_nodes.MinEdge.X; x <= new_nodes.MaxEdge.X; x++)
|
||||||
for (s16 y = new_nodes.MinEdge.Y; y <= new_nodes.MaxEdge.Y; y++)
|
for (s16 y = new_nodes.MinEdge.Y; y <= new_nodes.MaxEdge.Y; y++)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue