forked from MineClone5/MineClone5
Fix some builtin_item crashes
This commit is contained in:
parent
a32083c81b
commit
92c101d731
|
@ -94,7 +94,7 @@ minetest.register_entity(":__builtin:item", {
|
||||||
local p = self.object:getpos()
|
local p = self.object:getpos()
|
||||||
|
|
||||||
local name = minetest.get_node(p).name
|
local name = minetest.get_node(p).name
|
||||||
if minetest.registered_nodes[name].damage_per_second > 0 or name == "maptools:igniter" then
|
if (minetest.registered_nodes[name] and minetest.registered_nodes[name].damage_per_second > 0) or name == "maptools:igniter" then
|
||||||
minetest.sound_play("builtin_item_lava", {pos = self.object:getpos(), gain = 0.5})
|
minetest.sound_play("builtin_item_lava", {pos = self.object:getpos(), gain = 0.5})
|
||||||
self.object:remove()
|
self.object:remove()
|
||||||
return
|
return
|
||||||
|
@ -107,7 +107,7 @@ minetest.register_entity(":__builtin:item", {
|
||||||
end
|
end
|
||||||
--]]
|
--]]
|
||||||
|
|
||||||
if minetest.registered_nodes[name].liquidtype == "flowing" then
|
if minetest.registered_nodes[name] and minetest.registered_nodes[name].liquidtype == "flowing" then
|
||||||
get_flowing_dir = function(self)
|
get_flowing_dir = function(self)
|
||||||
local pos = self.object:getpos()
|
local pos = self.object:getpos()
|
||||||
local param2 = minetest.get_node(pos).param2
|
local param2 = minetest.get_node(pos).param2
|
||||||
|
|
Loading…
Reference in New Issue