diff options
author | orwell96 <mono96.mml@gmail.com> | 2017-11-14 23:16:08 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-14 23:16:08 +0100 |
commit | ce73643b107bb9cd7390f42457634d311b70c761 (patch) | |
tree | 42b7b1cafa215185cef671c326a82b439ef28811 /advtrains | |
parent | 17ee62dc643ccc568920697cec3786d2c0eb82ec (diff) | |
download | advtrains-ce73643b107bb9cd7390f42457634d311b70c761.tar.gz advtrains-ce73643b107bb9cd7390f42457634d311b70c761.tar.bz2 advtrains-ce73643b107bb9cd7390f42457634d311b70c761.zip |
Do not punch signs
For some reason, a sign text gets removed by a train when it drives by.
This should fix it.
Diffstat (limited to 'advtrains')
-rw-r--r-- | advtrains/trainlogic.lua | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/advtrains/trainlogic.lua b/advtrains/trainlogic.lua index 0f71ad6..c158ebe 100644 --- a/advtrains/trainlogic.lua +++ b/advtrains/trainlogic.lua @@ -598,7 +598,8 @@ function advtrains.train_step_b(id, train, dtime) --- 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 obj:get_armor_groups().fleshy and obj:get_armor_groups().fleshy > 0 then + if not obj:is_player() and obj:get_armor_groups().fleshy and obj:get_armor_groups().fleshy > 0 + and obj:get_luaentity() and obj:get_luaentity().name~="signs:text" then obj:punch(obj, 1, { full_punch_interval = 1.0, damage_groups = {fleshy = 1000}, }, nil) end end |