Copy link
@asl97

asl97 Apr 1, 2017

Contributor

@VanessaE They are talking about the sulfur_buf, not the sulfur_noise

@paramat This does not work. With the following debug patch:

--- a/technic_worldgen/oregen.lua
+++ b/technic_worldgen/oregen.lua
@@ -126,6 +126,8 @@ minetest.register_on_generated(function(minp, maxp, seed)
                MaxEdge = {x = emax.x, y = emax.y, z = emax.z},
        }
        local data = vm:get_data(sulfur_buf)
+       print("sulfur_buf: ", sulfur_buf)
+       print("data: ", data)
        local pr = PseudoRandom(17 * minp.x + 42 * minp.y + 101 * minp.z)
        sulfur_noise = sulfur_noise or minetest.get_perlin(9876, 3, 0.5, 100)

It output:

sulfur_buf: 	nil
data: 	table: 0x418a7850
sulfur_buf: 	nil
data: 	table: 0x408cac40

Only with local sulfur_buf = {} does it reuse the table:

sulfur_buf: 	table: 0x4077e8d8
data: 	table: 0x4077e8d8
sulfur_buf: 	table: 0x4077e8d8
data: 	table: 0x4077e8d8

PS: Honestly, some might not realize that sulfur_buf and data are the same thing when they read the code >.>