summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNovatux <nathanael.courant@laposte.net>2014-08-14 21:18:48 +0200
committerNovatux <nathanael.courant@laposte.net>2014-08-14 21:18:48 +0200
commitd4e14bc8916e18457f3f3960f5272836d3d65c60 (patch)
tree9c5613a1e1261ed93963153359977f6c3ad660fa
parentd5480f5ff0ede03df2d212e2236e2da71c1046da (diff)
downloadpipeworks-d4e14bc8916e18457f3f3960f5272836d3d65c60.tar
pipeworks-d4e14bc8916e18457f3f3960f5272836d3d65c60.tar.gz
pipeworks-d4e14bc8916e18457f3f3960f5272836d3d65c60.tar.bz2
pipeworks-d4e14bc8916e18457f3f3960f5272836d3d65c60.tar.xz
pipeworks-d4e14bc8916e18457f3f3960f5272836d3d65c60.zip
Add legacy code for items in tubes
-rwxr-xr-xitem_transport.lua13
1 files changed, 12 insertions, 1 deletions
diff --git a/item_transport.lua b/item_transport.lua
index db4ffb0..3a18217 100755
--- a/item_transport.lua
+++ b/item_transport.lua
@@ -313,7 +313,18 @@ minetest.register_entity("pipeworks:tubed_item", {
end,
get_staticdata = luaentity.get_staticdata,
- on_activate = luaentity.on_activate,
+ on_activate = function(self, staticdata) -- Legacy code, should be replaced later by luaentity.on_activate
+ if staticdata == "" or staticdata == nil then
+ return
+ end
+ if staticdata == "toremove" then
+ self.object:remove()
+ return
+ end
+ local item = minetest.deserialize(staticdata)
+ pipeworks.tube_item(self.object:getpos(), item.start_pos, item.velocity, item.itemstring)
+ self.object:remove()
+ end,
})
minetest.register_entity("pipeworks:color_entity", {