Make the code more stable
parent
cbe53d3bbf
commit
d4819fc13e
2
api.lua
2
api.lua
|
@ -95,7 +95,7 @@ function mobs:register_mob(name, def)
|
||||||
end
|
end
|
||||||
|
|
||||||
local do_env_damage = function(self)
|
local do_env_damage = function(self)
|
||||||
if self.light_damage and self.light_damage ~= 0 and self.object:getpos().y>0 and minetest.env:get_node_light(self.object:getpos()) > 3 then
|
if self.light_damage and self.light_damage ~= 0 and self.object:getpos().y>0 and minetest.env:get_node_light(self.object:getpos()) and minetest.env:get_node_light(self.object:getpos()) > 3 then
|
||||||
self.object:punch(self.object, 1.0, {
|
self.object:punch(self.object, 1.0, {
|
||||||
full_punch_interval=1.0,
|
full_punch_interval=1.0,
|
||||||
groupcaps={
|
groupcaps={
|
||||||
|
|
Loading…
Reference in New Issue