Fix entity damage
Animals from mobs weren't damaged because they have the immortal group set. Instead, we check for the existence of "fleshy".master
parent
9294e770ca
commit
480011c781
|
@ -598,8 +598,8 @@ function advtrains.train_step_b(id, train, dtime)
|
||||||
--- 8c damage other objects ---
|
--- 8c damage other objects ---
|
||||||
local objs = minetest.get_objects_inside_radius(rcollpos, 2)
|
local objs = minetest.get_objects_inside_radius(rcollpos, 2)
|
||||||
for _,obj in ipairs(objs) do
|
for _,obj in ipairs(objs) do
|
||||||
if not obj:is_player() and not obj:get_armor_groups().immortal==1 then
|
if not obj:is_player() and obj:get_armor_groups().fleshy and obj:get_armor_groups().fleshy > 0 then
|
||||||
obj:punch(nil, 1, { full_punch_interval = 1.0, damage_groups = {fleshy = 1000}, }, nil)
|
obj:punch(obj, 1, { full_punch_interval = 1.0, damage_groups = {fleshy = 1000}, }, nil)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue