2019-01-04 02:28:14 +02:00
|
|
|
-- rocket launch always yields space science -- by mewmew
|
|
|
|
|
2021-03-24 21:14:55 +02:00
|
|
|
local Event = require 'utils.event'
|
2019-01-04 02:28:14 +02:00
|
|
|
|
2021-03-24 17:46:00 +02:00
|
|
|
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})
|
2019-01-04 02:28:14 +02:00
|
|
|
end
|
2021-03-24 17:46:00 +02:00
|
|
|
|
2021-03-24 21:14:55 +02:00
|
|
|
Event.add(defines.events.on_rocket_launched, on_rocket_launched)
|