D00Med / LegendofMinetest

Minetest game based on Legend of Zelda
15 stars 7 forks source link

Update init.lua #34

Closed jcfrosty closed 6 years ago

jcfrosty commented 6 years ago

Same problem with order of lower#,higher# when using random function.

D00Med commented 6 years ago

Thankyou for this. I won't merge just yet because I still don't know enough about the problem.

jcfrosty commented 6 years ago

if you have hangouts, I can let you know what the issue is. its just a simple switching of the high and low numbers when using math.random(). so for example it says #2 is invalid when using math.random(-25,-30) because -30 is actually a lower number than -25. so it should be math.random(-30,-25). For some reason this cause the game to not even run on my son's desktop while using lua 5.1.3 . Switching them around fixed it.

D00Med commented 6 years ago

I understand the idea, but I have never had this problem before, I have been playing the game for months without encountering this problem, and I need to make sure it's not something to do with minetest's version or something else.

I just tested this: minetest.register_on_generated(function(minp, maxp) minetest.chat_send_all(math.random(-10,-30)) end) And it works fine. But it did also work with the numbers swapped. This afternoon I will have a look at swapping the numbers around in the subgame anyway, I guess it's likely to be broken if the number placement becomes fixed in future versions.

D00Med commented 6 years ago

Thankyou very much for these PR's