Memory Storage 📦


An alternative to warehouses. The Memory Unit can store an infinite amount of a single item type. The more items you store, the more power it will require!

Content
15 days ago
1.0 - 2.0
36.8K
Storage

g Bug with SE spaceships

1 year, 11 months ago

When i use the memory storage on a spaceship, the electric draw from the memory units adds on one unit with every start of the spaceship.
on my ship the electric power info shows 25 memory units, but i have none on the ship..

1 year, 11 months ago

This is SE's fault, and I can't fix from my end.

Whenever they make a new spaceship, they are running entity.clone() on every entity.
However, to delete the old spaceship, they use entity.destroy()

Earendel must instead use entity.delete{raise_destroy=true}
This change will allow my code to properly handle the deletion.

Feel free to modify SE's code manually. I also recommend creating a bug report in the SE git or discord.

1 year, 10 months ago
(updated 1 year, 10 months ago)

Did not test it in-game, but looking at the SE code it seems we already do raise that event for anything but spaceship walls and spider legs.

[...]
elseif entity_name == "se-spaceship-wall" then
  entity.destroy()
elseif entity_type ~= "spider-leg" then
  util.safe_destroy(entity)
end

function util.safe_destroy(entity)
  if not entity.valid then return end
  if entity.type == "linked-container" then
    entity.link_id = 0
    entity.destroy({raise_destroy=true})
  else
    entity.destroy({raise_destroy=true})
  end
end