1
0
mirror of https://github.com/Refactorio/RedMew.git synced 2025-01-18 03:21:47 +02:00

Merge pull request #2 from Claude477/patch-5

update2
This commit is contained in:
BlueRock (on discord) 2020-02-04 18:48:03 -05:00 committed by GitHub
commit 902540aa17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -166,7 +166,7 @@ function DiggyHole.register(cfg)
end end
diggy_hole(entity) diggy_hole(entity)
if event.cause then if event.cause then
destroy_rock(entity.surface.create_entity, 10, entity.position) destroy_rock(entity.surface.create_particle, 10, entity.position)
end end
end) end)
@ -200,19 +200,20 @@ function DiggyHole.register(cfg)
local graphics_variation = entity.graphics_variation local graphics_variation = entity.graphics_variation
local create_entity = entity.surface.create_entity local create_entity = entity.surface.create_entity
local create_particle = entity.surface.create_particle
local position = entity.position local position = entity.position
local force = event.robot.force local force = event.robot.force
if health < 1 then if health < 1 then
raise_event(defines.events.on_entity_died, {entity = entity, force = force}) raise_event(defines.events.on_entity_died, {entity = entity, force = force})
mine_rock(create_entity, 6, position) mine_rock(create_particle, 6, position)
entity.destroy() entity.destroy()
return return
end end
entity.destroy() entity.destroy()
local rock = create_entity({name = name, position = position}) local rock = create_entity({name = name, position = position})
mine_rock(create_entity, 1, position) mine_rock(create_particle, 1, position)
rock.graphics_variation = graphics_variation rock.graphics_variation = graphics_variation
rock.order_deconstruction(force) rock.order_deconstruction(force)
rock.health = health rock.health = health
@ -228,7 +229,7 @@ function DiggyHole.register(cfg)
event.buffer.clear() event.buffer.clear()
diggy_hole(entity) diggy_hole(entity)
mine_rock(entity.surface.create_entity, 6, entity.position) mine_rock(entity.surface.create_particle, 6, entity.position)
end) end)
Event.add(defines.events.on_robot_mined_tile, function (event) Event.add(defines.events.on_robot_mined_tile, function (event)