mirror of
https://github.com/mt-mods/pipeworks.git
synced 2024-11-09 17:03:58 +01:00
Handle nil return value for add_item
Remove old comments. Current HEAD requires version ~0.4.16
This commit is contained in:
parent
6492b8ec76
commit
6fdda18390
@ -350,8 +350,10 @@ luaentity.register_entity("pipeworks:tubed_item", {
|
|||||||
-- compatible with Minetest 0.4.13.
|
-- compatible with Minetest 0.4.13.
|
||||||
-- Using item_drop here makes Minetest 0.4.13 crash.
|
-- Using item_drop here makes Minetest 0.4.13 crash.
|
||||||
local dropped_item = minetest.add_item(self.start_pos, stack)
|
local dropped_item = minetest.add_item(self.start_pos, stack)
|
||||||
dropped_item:set_velocity(vector.multiply(velocity, 5))
|
if dropped_item then
|
||||||
self:remove()
|
dropped_item:set_velocity(vector.multiply(velocity, 5))
|
||||||
|
self:remove()
|
||||||
|
end
|
||||||
return
|
return
|
||||||
else
|
else
|
||||||
velocity = vector.multiply(velocity, -1)
|
velocity = vector.multiply(velocity, -1)
|
||||||
|
Loading…
Reference in New Issue
Block a user