Hi,
My server was crashing because privs was nil. I checked for nil as follows.
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
aa0001@minetest01:~/minetest/mods$ diff node_owner/node_owner/init.lua ~/minetest/minetest-0.4.12-neuromancer/mods/node_owner/node_owner/init.lua
23,26c23,28
< if owner ~= player and owner ~= '' and privs.admin_node ~= true then
< minetest.chat_send_player(player, "You can not place nodes here because it is owned by "..owner..".")
< return itemstack
< end
---
> if (privs ~= nil) then
> if owner ~= player and owner ~= '' and privs.admin_node ~= true then
> minetest.chat_send_player(player, "You can not place nodes here because it is owned by "..owner..".")
> return itemstack
> end
> end
46,48c48,52
< if owner ~= player and owner ~= '' and privs.admin_node ~= true then
< minetest.chat_send_player(player, "You can not dig this node because it is owned by "..owner..".")
< return
---
> if (privs ~= nil) then
> if owner ~= player and owner ~= '' and privs.admin_node ~= true then
> minetest.chat_send_player(player, "You can not dig this node because it is owned by "..owner..".")
> return
> end
The issue is now itemstack is not returned if privs are nil. This is causing the cannons mod to crash. Could you help resolve the issue since my fix is half baked. I have a lot of mods, only the cannons is crashing so maybe the fix has to be there. Either way, willing to help resolve the issue.