Punch non-player objects when they get overridden by a train.

This commit is contained in:
orwell96 2017-10-25 14:04:20 +02:00
parent 3659fa9e63
commit cac7753158
1 changed files with 7 additions and 0 deletions

View File

@ -595,6 +595,13 @@ function advtrains.train_step_b(id, train, dtime)
end
end
end
--- 8c damage other objects ---
local objs = minetest.get_objects_inside_radius(rcollpos, 2)
for _,obj in ipairs(objs) do
if not obj:is_player() and not obj:get_armor_groups().immortal==1 then
obj:punch(nil, 1, { full_punch_interval = 1.0, damage_groups = {fleshy = 1000}, }, nil)
end
end
end
end
end