-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Attempt to index nil value caused by nodes with invalid param2 #610
Comments
This is probably due to an invalid param2 value on a node whose paramtype2 is Possible culprits are buttons, levers, solar panels, and wall-mounted lamps. There may be others depending on what other mods you have that use Mesecons. |
Server crashed again, just a few moments ago.
I discovered something interesting, everytime this crash happens, a player digs this node: |
Can you see what the param2 value is before the node is dug? (Using the F5 debug info.) |
I can reproduce the crash. It makes sense, since 30 % 8 = 6. But I don't know how the node got that way. To prevent the crash, this patch to Mesecons should work: diff --git a/mesecons/presets.lua b/mesecons/presets.lua
index e10dd36..64f2bff 100644
--- a/mesecons/presets.lua
+++ b/mesecons/presets.lua
@@ -74,6 +74,7 @@ end
mesecon.rules.wallmounted_get = function(node)
local dir = minetest.wallmounted_to_dir(node.param2)
+ if not dir then return {} end
return rules_from_dir(rules_wallmounted, dir)
end |
Thank you very much for your help @TurkeyMcMac, your information about the param2 stuff and the little hotfix! ❤️ |
@TurkeyMcMac can you make a PR with your patch? |
Will do. |
I use the latest master on Minetest 5.5.0
I have no clue what went wrong or how to reproduce it...
And keep in mind that 'wielded_light' is blamed wrongfully here: #609
The 'wielded_light' mod has no variable called "dir", but https://github.com/minetest-mods/mesecons/blob/master/mesecons/presets.lua#L66 does.
The text was updated successfully, but these errors were encountered: