summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim <t4im@users.noreply.github.com>2015-01-28 21:47:50 +0100
committerTim <t4im@users.noreply.github.com>2015-01-28 21:47:50 +0100
commit3bcf3b5f2f37a7b1268c6a072671934666852017 (patch)
tree2482214f75657479e952a364e4990962517cb668
parentb009e4659013caa6b8afe1f70c13ce5c3a5ffb0c (diff)
downloadpipeworks-3bcf3b5f2f37a7b1268c6a072671934666852017.tar
pipeworks-3bcf3b5f2f37a7b1268c6a072671934666852017.tar.gz
pipeworks-3bcf3b5f2f37a7b1268c6a072671934666852017.tar.bz2
pipeworks-3bcf3b5f2f37a7b1268c6a072671934666852017.tar.xz
pipeworks-3bcf3b5f2f37a7b1268c6a072671934666852017.zip
use on_destruct instead of after_dig_node to clean up the cache entry to avoid any leaking during worldediting
-rw-r--r--autocrafter.lua2
1 files changed, 2 insertions, 0 deletions
diff --git a/autocrafter.lua b/autocrafter.lua
index 2ccdba6..40d7c4c 100644
--- a/autocrafter.lua
+++ b/autocrafter.lua
@@ -251,6 +251,8 @@ minetest.register_node("pipeworks:autocrafter", {
after_place_node = pipeworks.scan_for_tube_objects,
after_dig_node = function(pos)
pipeworks.scan_for_tube_objects(pos)
+ end,
+ on_destruct = function(pos)
autocrafterCache[minetest.hash_node_position(pos)] = nil
end,
allow_metadata_inventory_put = function(pos, listname, index, stack, player)