Closed Bu-Gee closed 6 years ago
This patch appears to fix it, but to be perfectly honest, I don't know what else it breaks.
--- init.orig.lua 2018-03-04 16:47:53.249458663 -0500
+++ init.lua 2018-03-04 16:45:30.330049391 -0500
@@ -214,11 +214,14 @@
-- Check if node will yield its useful drop by the digger's tool
local dug_node = minetest.get_node(pos)
- local tool = digger:get_wielded_item()
- local toolcaps = tool:get_tool_capabilities()
+ local toolcaps = nil
+ if digger ~= nil then
+ local tool = digger:get_wielded_item()
+ toolcaps = tool:get_tool_capabilities()
- if not check_can_drop(dug_node.name, toolcaps) then
- return
+ if not check_can_drop(dug_node.name, toolcaps) then
+ return
+ end
end
--[[ Special node drops when dug by shears by reading _mcl_shears_drop
@@ -228,7 +231,7 @@
* table: Drop every itemstring in this table when dub by shears
]]
local nodedef = minetest.registered_nodes[dug_node.name]
- if toolcaps.groupcaps and toolcaps.groupcaps.shearsy_dig and nodedef._mcl_shears_drop then
+ if toolcaps ~= nil and toolcaps.groupcaps and toolcaps.groupcaps.shearsy_dig and nodedef._mcl_shears_drop then
if nodedef._mcl_shears_drop == true then
drops = { dug_node.name }
else
The patch looks fine to me. The crash has been fixed. Thanks for reporting.
Here is the stack trace. I placed a redstone torch to activate a circuit which pushes a piston to break a pumpkin. I got this stack trace:
The game crashed. When I started it back up, the pumpkin is where it was and the redstone circuit was deactivated.
Best I can tell is that it looks like a missing digger index.
Update: I also tried this in creative mode and the pumpkin breaks but it doesn't leave anything to pick up. Does that mean it wasn't dug?