mirror of
https://codeberg.org/tenplus1/mobs_redo.git
synced 2025-05-08 20:10:30 +02:00
is_node_dangerous only if damage > 0
This commit is contained in:
parent
68b25c9d08
commit
b977431e21
11
api.lua
11
api.lua
@ -18,7 +18,7 @@ end
|
|||||||
-- global table
|
-- global table
|
||||||
|
|
||||||
mobs = {
|
mobs = {
|
||||||
mod = "redo", version = "20250411",
|
mod = "redo", version = "20250501",
|
||||||
spawning_mobs = {}, translate = S,
|
spawning_mobs = {}, translate = S,
|
||||||
node_snow = has(minetest.registered_aliases["mapgen_snow"])
|
node_snow = has(minetest.registered_aliases["mapgen_snow"])
|
||||||
or has("mcl_core:snow") or has("default:snow") or "air",
|
or has("mcl_core:snow") or has("default:snow") or "air",
|
||||||
@ -828,9 +828,9 @@ local function is_node_dangerous(self, nodename)
|
|||||||
|
|
||||||
local def = minetest.registered_nodes[nodename]
|
local def = minetest.registered_nodes[nodename]
|
||||||
|
|
||||||
if (self.water_damage and def.groups.water)
|
if (self.water_damage and self.water_damage > 0 and def.groups.water)
|
||||||
or (self.lava_damage and def.groups.lava)
|
or (self.lava_damage and self.lava_damage > 0 and def.groups.lava)
|
||||||
or (self.fire_damage and def.groups.fire) then return true end
|
or (self.fire_damage and self.fire_damage > 0 and def.groups.fire) then return true end
|
||||||
|
|
||||||
if self.node_damage and def.damage_per_second > 0 then
|
if self.node_damage and def.damage_per_second > 0 then
|
||||||
|
|
||||||
@ -992,8 +992,7 @@ function mob_class:do_env_damage()
|
|||||||
light = minetest.get_node_light(pos) or 0
|
light = minetest.get_node_light(pos) or 0
|
||||||
end
|
end
|
||||||
|
|
||||||
if light >= self.light_damage_min
|
if light >= self.light_damage_min and light <= self.light_damage_max then
|
||||||
and light <= self.light_damage_max then
|
|
||||||
|
|
||||||
self.health = self.health - self.light_damage
|
self.health = self.health - self.light_damage
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user