Check for on_metadata_inventory_take
authorCy <whatever>
Tue, 15 Oct 2013 22:29:55 +0000 (15:29 -0700)
committerVanessa Ezekowitz <vanessaezekowitz@gmail.com>
Tue, 15 Oct 2013 22:37:45 +0000 (18:37 -0400)
item_transport.lua

index ff2d86537b3f7c3dc4793a053948d0d44dc153a9..721aa198fb20be14db28996b6dd58089ecbeb282 100644 (file)
@@ -138,7 +138,9 @@ function grabAndFire(frominv,frominvname,frompos,fromnode,sname,tube,idef,dir,al
                 else
                     item=stack:take_item(count)
                     frominv:set_stack(frominvname,spos,stack)
-                    idef.on_metadata_inventory_take(frompos, "main", spos, item, fakePlayer)
+                    if idef.on_metadata_inventory_take then
+                        idef.on_metadata_inventory_take(frompos, "main", spos, item, fakePlayer)
+                    end
                 end
                 item1=tube_item(frompos,item)
                 item1:get_luaentity().start_pos = frompos