Update tree-decon.lua

This commit is contained in:
2023-10-14 02:08:53 +09:00
committed by GitHub
parent 44c7cae563
commit 193f3e3b88

View File

@@ -103,7 +103,13 @@ Event.add(defines.events.on_entity_damaged, function(event)
return
end
if event.entity.type == 'tree' or event.entity.type == 'simple-entity' then
event.entity.destroy()
if not (event.entity.type == 'tree' or event.entity.type == 'simple-entity') then
return
end
if (not event.cause) or (event.cause.type ~= 'car')then
return
end
event.entity.destroy()
end)