mirror of
https://github.com/mt-mods/pipeworks.git
synced 2025-06-29 23:00:49 +02:00
fix multiple crash points if luaentity.entities or values returned from
luaentity.add_entity() are nil
This commit is contained in:
@ -6,6 +6,7 @@ function pipeworks.tube_inject_item(pos, start_pos, velocity, item)
|
||||
-- Take item in any format
|
||||
local stack = ItemStack(item)
|
||||
local obj = luaentity.add_entity(pos, "pipeworks:tubed_item")
|
||||
if not obj then return end
|
||||
obj:set_item(stack:to_string())
|
||||
obj.start_pos = vector.new(start_pos)
|
||||
obj:setvelocity(velocity)
|
||||
|
Reference in New Issue
Block a user