summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcheapie <no-email-for-you@example.com>2016-06-10 16:10:23 -0500
committercheapie <no-email-for-you@example.com>2016-06-10 16:10:23 -0500
commit87c223b142bc72fdc037f1ca063a74caec8625e1 (patch)
tree8521e717f030c27cb0eda96022ae2fedae694192
parente5837a6e300ee444f4092ade6b836362670c657c (diff)
downloadrgblightstone-87c223b142bc72fdc037f1ca063a74caec8625e1.tar
rgblightstone-87c223b142bc72fdc037f1ca063a74caec8625e1.tar.gz
rgblightstone-87c223b142bc72fdc037f1ca063a74caec8625e1.tar.bz2
rgblightstone-87c223b142bc72fdc037f1ca063a74caec8625e1.tar.xz
rgblightstone-87c223b142bc72fdc037f1ca063a74caec8625e1.zip
Fix rare crash when unknown entities are within the lightstone
-rw-r--r--init.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/init.lua b/init.lua
index 539deab..609e500 100644
--- a/init.lua
+++ b/init.lua
@@ -124,7 +124,7 @@ minetest.register_node("rgblightstone:rgblightstone", {
--Remove old entity, if present
local objs = minetest.get_objects_inside_radius(pos,0.5)
for _,obj in ipairs(objs) do
- if obj:get_luaentity().name == "rgblightstone:entity" then
+ if obj:get_luaentity() and obj:get_luaentity().name == "rgblightstone:entity" then
obj:remove()
end
end
@@ -148,7 +148,7 @@ minetest.register_lbm({
action = function(pos)
local objs = minetest.get_objects_inside_radius(pos,0.5)
for _,obj in ipairs(objs) do
- if obj:get_luaentity().name == "rgblightstone:entity" then
+ if obj:get_luaentity() and obj:get_luaentity().name == "rgblightstone:entity" then
obj:remove()
end
end