diff options
author | orwell96 <orwell@bleipb.de> | 2017-10-25 14:04:20 +0200 |
---|---|---|
committer | orwell96 <orwell@bleipb.de> | 2017-10-25 14:04:20 +0200 |
commit | cac7753158531b17900bb71619bfb03b4e071d5f (patch) | |
tree | 17db63b858ee06126b36f88ef193a58b8bc13e59 /advtrains/trainlogic.lua | |
parent | 3659fa9e6308a0aaf2774aba7191e1bfd4df72d8 (diff) | |
download | advtrains-cac7753158531b17900bb71619bfb03b4e071d5f.tar.gz advtrains-cac7753158531b17900bb71619bfb03b4e071d5f.tar.bz2 advtrains-cac7753158531b17900bb71619bfb03b4e071d5f.zip |
Punch non-player objects when they get overridden by a train.
Diffstat (limited to 'advtrains/trainlogic.lua')
-rw-r--r-- | advtrains/trainlogic.lua | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/advtrains/trainlogic.lua b/advtrains/trainlogic.lua index 381e1a0..f76ec9d 100644 --- a/advtrains/trainlogic.lua +++ b/advtrains/trainlogic.lua @@ -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 |