forked from Mineclonia/Mineclonia
Compare commits
1 Commits
master
...
fix-find-n
Author | SHA1 | Date |
---|---|---|
Nils Dagsson Moskopp | 94d0b77b54 |
|
@ -0,0 +1,28 @@
|
|||
local S = minetest.get_translator("mcl_engine_workarounds")
|
||||
|
||||
minetest.register_chatcommand("crash_with_find_nodes_in_area", {
|
||||
description = S("Try crashing the game using minetest.find_nodes_in_area()."),
|
||||
privs = { debug = true },
|
||||
func = function(name)
|
||||
-- In vanilla client, the map is only ever visible until x=31007
|
||||
local pos = { x=0, y=0, z=0 }
|
||||
local radius = 1
|
||||
local minp = pos -- vector.subtract(pos, radius)
|
||||
local maxp = pos -- vector.add(pos, radius)
|
||||
local vm = minetest.get_voxel_manip()
|
||||
local data = vm:read_from_map(
|
||||
minp,
|
||||
maxp
|
||||
)
|
||||
local c_air = minetest.get_content_id("mcl_core:bedrock")
|
||||
data[0] = c_air
|
||||
vm:set_data(data)
|
||||
vm:write_to_map(true)
|
||||
local npos, nnum = minetest.find_nodes_in_area(
|
||||
minp,
|
||||
maxp,
|
||||
{ "mcl_core:bedrock" }
|
||||
)
|
||||
minetest.debug(nnum["mcl_core:bedrock"])
|
||||
end
|
||||
})
|
Loading…
Reference in New Issue