Page 1 of 1

[2.0.73] cargo landing pads happily accept pods they should not

Posted: Fri Feb 06, 2026 2:34 pm
by Quezler
When i create a new cargo pod and do NOT add it to the `receiving_cargo_units` of the `cargo-landing-pad` i expected the pad to not be able to receive them.

Observed behavior: the trash cargo pod and the requested cargo pod both land in the cargo landing pad.
Expected behavior: for the trash cargo pod to land on the surface, and for the space platform foundation request to not get fulfilled.

The relevant code, packaged in the attached mod for confirmation convenience:
(notice that print indeed says "cat" so the platform is not creating the wrong entity)

Code: Select all

local cat = table.deepcopy(data.raw["cargo-pod"]["cargo-pod"])
cat.name = "cat"
data:extend{cat}

for _, hatch_definition in pairs(data.raw["space-platform-hub"]["space-platform-hub"].cargo_station_parameters.hatch_definitions) do
  if hatch_definition.cargo_unit_entity_to_spawn == "cargo-pod" then
    hatch_definition.cargo_unit_entity_to_spawn = "cat"
  end
end

Code: Select all

script.on_init(function()
  local pad = game.surfaces.nauvis.create_entity{
    name = "cargo-landing-pad",
    force = "player",
    position = {0, 10},
  }

  local platform = game.forces.player.create_space_platform{name = "platform", planet = "nauvis", starter_pack = "space-platform-starter-pack"}
  local hub = platform.apply_starter_pack()

  hub.get_inventory(defines.inventory.hub_trash).insert("wood")
  pad.get_logistic_sections().sections[1].set_slot(1, {value = {type = "item", name = "space-platform-foundation", quality = "normal"}, min = 10})
end)

script.on_event(defines.events.on_cargo_pod_started_ascending, function(event)
  game.print(event.cargo_pod.name)
end)