Commit Graph

2 Commits

Author SHA1 Message Date
cora d0540c3a1c add a setting to opt-in for selftests 2021-12-14 00:21:34 +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