diff options
author | SmallJoker <mk939@ymail.com> | 2018-08-04 12:27:09 +0200 |
---|---|---|
committer | SmallJoker <mk939@ymail.com> | 2018-08-04 12:27:09 +0200 |
commit | 6fdda1839064684f77c9ea7f3e087a2d3d6fa388 (patch) | |
tree | 20e9baf4048970bf8eecf1c6d596bc95db60d2dc /item_transport.lua | |
parent | 6492b8ec7650f4f76c9eded84418fe9e9fc6df71 (diff) |
Handle nil return value for add_item
Remove old comments. Current HEAD requires version ~0.4.16
Diffstat (limited to 'item_transport.lua')
-rw-r--r-- | item_transport.lua | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/item_transport.lua b/item_transport.lua index 388e2e7..d3a13c5 100644 --- a/item_transport.lua +++ b/item_transport.lua @@ -350,8 +350,10 @@ luaentity.register_entity("pipeworks:tubed_item", { -- compatible with Minetest 0.4.13. -- Using item_drop here makes Minetest 0.4.13 crash. local dropped_item = minetest.add_item(self.start_pos, stack) - dropped_item:set_velocity(vector.multiply(velocity, 5)) - self:remove() + if dropped_item then + dropped_item:set_velocity(vector.multiply(velocity, 5)) + self:remove() + end return else velocity = vector.multiply(velocity, -1) |