Commit graph

2 commits

Author SHA1 Message Date
Nils Dagsson Moskopp
0b5fa14041 Do not crash if minetest.find_nodes_in_area() lies 2021-12-20 21:38:24 +01:00
Nils Dagsson Moskopp
526c25aa57
Add crash fix and tests for minetest.find_nodes_in_area()
For some specific out of bounds values, the volume calculation in
minetest.find_nodes_in_area() is off by about four million nodes.
Unfortunately that behaviour made it trivial to crash Mineclonia,
as Minetest immediately crashes upon encountering large numbers.

This commit introduces a wrapper around minetest.find_nodes_in_area()
which should avoid a crash. Additionally, three self tests are executed
when a server starts; they crash Mineclonia in case the workaround fails.
2021-11-18 00:55:59 +01:00