fix nil bug
This commit is contained in:
parent
747986b209
commit
2e1aba1aa1
10
init.lua
10
init.lua
@ -47,14 +47,16 @@ local function fall_hurt_check(self, pos)
|
|||||||
for _,obj in ipairs(all_objects) do
|
for _,obj in ipairs(all_objects) do
|
||||||
|
|
||||||
local name = obj:get_luaentity() and
|
local name = obj:get_luaentity() and
|
||||||
obj:get_luaentity().name or ""
|
obj:get_luaentity().name
|
||||||
|
|
||||||
if name ~= "__builtin:item"
|
if (name
|
||||||
and name ~= "__builtin:falling_node" then
|
and name ~= "__builtin:item"
|
||||||
|
and name ~= "__builtin:falling_node")
|
||||||
|
or obj:is_player() then
|
||||||
|
|
||||||
obj:punch(self.object, 4.0, {
|
obj:punch(self.object, 4.0, {
|
||||||
damage_groups = {fleshy = damage}
|
damage_groups = {fleshy = damage}
|
||||||
})
|
}, nil)
|
||||||
|
|
||||||
self.hurt_toggle = false
|
self.hurt_toggle = false
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user