deconstruction of tree and rocks when drive over them

This commit is contained in:
2023-10-13 23:51:01 +09:00
committed by GitHub
parent 3b66ab1123
commit 44c7cae563

View File

@@ -97,3 +97,13 @@ Event.on_nth_tick(300, function()
chache[key] = nil
end
end)
Event.add(defines.events.on_entity_damaged, function(event)
if not (event.damage_type.name == 'impact' and event.force) then
return
end
if event.entity.type == 'tree' or event.entity.type == 'simple-entity' then
event.entity.destroy()
end
end)