mirror of
https://codeberg.org/tenplus1/mobs_redo.git
synced 2024-12-24 01:30:22 +01:00
fix crash (thanks SwissalpS)
This commit is contained in:
parent
e83620553d
commit
b756aa50f5
14
api.lua
14
api.lua
@ -8,7 +8,7 @@ local use_cmi = minetest.global_exists("cmi")
|
|||||||
|
|
||||||
mobs = {
|
mobs = {
|
||||||
mod = "redo",
|
mod = "redo",
|
||||||
version = "20220115",
|
version = "20220116",
|
||||||
intllib = S,
|
intllib = S,
|
||||||
invis = minetest.global_exists("invisibility") and invisibility or {}
|
invis = minetest.global_exists("invisibility") and invisibility or {}
|
||||||
}
|
}
|
||||||
@ -1002,19 +1002,19 @@ end
|
|||||||
|
|
||||||
|
|
||||||
-- Returns true is node can deal damage to self
|
-- Returns true is node can deal damage to self
|
||||||
function mobs:is_node_dangerous(self, nodename)
|
function mobs:is_node_dangerous(mob_obj, nodename)
|
||||||
|
|
||||||
if self.water_damage > 0
|
if mob_obj.water_damage > 0
|
||||||
and minetest.get_item_group(nodename, "water") ~= 0 then
|
and minetest.get_item_group(nodename, "water") ~= 0 then
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
if self.lava_damage > 0
|
if mob_obj.lava_damage > 0
|
||||||
and minetest.get_item_group(nodename, "lava") ~= 0 then
|
and minetest.get_item_group(nodename, "lava") ~= 0 then
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
if self.fire_damage > 0
|
if mob_obj.fire_damage > 0
|
||||||
and minetest.get_item_group(nodename, "fire") ~= 0 then
|
and minetest.get_item_group(nodename, "fire") ~= 0 then
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
@ -1026,8 +1026,8 @@ function mobs:is_node_dangerous(self, nodename)
|
|||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
local function is_node_dangerous(self, nodename)
|
local function is_node_dangerous(mob_obj, nodename)
|
||||||
return mobs:is_node_dangerous(self, nodename)
|
return mobs:is_node_dangerous(mob_obj, nodename)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user