From 85159a4f1f12ed1c84d5f2be6aa3f90611334b6b Mon Sep 17 00:00:00 2001 From: CaitSith2 Date: Tue, 12 Nov 2024 17:03:27 -0800 Subject: [PATCH] Factorio: Fix satellite goal (#4183) --- worlds/factorio/data/mod_template/control.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/worlds/factorio/data/mod_template/control.lua b/worlds/factorio/data/mod_template/control.lua index 51a588a94cb9..4383357546d9 100644 --- a/worlds/factorio/data/mod_template/control.lua +++ b/worlds/factorio/data/mod_template/control.lua @@ -310,7 +310,12 @@ script.on_event(defines.events.on_player_removed, on_player_removed) function on_rocket_launched(event) if event.rocket and event.rocket.valid and storage.forcedata[event.rocket.force.name]['victory'] == 0 then - if event.rocket.get_item_count("satellite") > 0 or GOAL == 0 then + satellite_count = 0 + cargo_pod = event.rocket.cargo_pod + if cargo_pod then + satellite_count = cargo_pod.get_item_count("satellite") + end + if satellite_count > 0 or GOAL == 0 then storage.forcedata[event.rocket.force.name]['victory'] = 1 dumpInfo(event.rocket.force) game.set_game_state