Do not punch signs

For some reason, a sign text gets removed by a train when it drives by.
This should fix it.
This commit is contained in:
orwell96 2017-11-14 23:16:08 +01:00 committed by GitHub
parent 17ee62dc64
commit ce73643b10
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -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