1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2024-12-30 23:17:53 +02:00
ComfyFactorio/modules/rocket_launch_always_yields_science.lua
2021-03-24 20:14:55 +01:00

15 lines
555 B
Lua

-- rocket launch always yields space science -- by mewmew
local Event = require 'utils.event'
local function on_rocket_launched(event)
local rocket_inventory = event.rocket.get_inventory(defines.inventory.rocket)
if rocket_inventory.get_item_count('satellite') > 0 then
return
end
local rocket_silo_inventory = event.rocket_silo.get_inventory(defines.inventory.rocket_silo_result)
rocket_silo_inventory.insert({name = 'space-science-pack', count = 1000})
end
Event.add(defines.events.on_rocket_launched, on_rocket_launched)