Closed numberZero closed 6 years ago
Thanks for the PR but I don't understand what is wrong with the current code. minetest.global_exists
shouldn't cause a crash unless something else is wrongly declaring the technic
global?
However, I will merge since using a local variable based on the actual mod's existence is a better solution anyway :)
Edit: I'm just thinking, won't that local be out of scope there? Maybe not, Lua is kinda strange like that and I guess you did test this, right? I will do so myself when I get a chance, I'd like to understand this a little better.
“Should help” means “Didn’t test, but will work probably.” I just found out that it uses different methods (global_exists
in one place but get_modpath
in another) of detecting technic
in different places, and unified them. @expertmm Does this help actually?
On locals: each file (called via dofile
) has its own scope. Indeed, it behaves just like a function, it can even return values (and probably handle arguments as well, don’t remember).
Tested. It works.
With technic_worldgen
but no technic
, c812e0a crashes but 579d245 works.
Thanks again, I never really doubted you :)
https://github.com/minetest-mods/unified_inventory/issues/111 Should help.