Cargo Ships


Adds massive cargo ships to the game, that function similarly to trains. Also adds deep sea oil, oil platforms, tanker ships, train bridges and other water based content.

Content
17 days ago
0.16 - 2.0
266K
Transportation Logistics Trains Mining Fluids Power

b [fixed] Difficult to track bug with oil rigs

18 days ago
(updated 18 days ago)

I got this bug once in my game, and one of players have noticed it well more than once:

What's happening:
If you build oil rig far enough from place you are mostly playing over time it can randomly become unresponsive.
After checking what's going on issue is always the same.

for some reason every part of composite entity except for "drill" is gone, and I don't know why.
My suspicion is some kind of bug in part of control code responsible for destroying oil rig.

I can provide save file with oil rig broken state, but it's rly hard to replicate how it's happenning. (Already tried at least few times)

I also made an issue on github
https://github.com/robot256/cargo_ships/issues/59

18 days ago
(updated 18 days ago)

I think i know why it happens. There is a DestroyOilRig function, which is called from on_object_destroyed, and deletes all entities except from the main "oil_rig" one because its already destroyed. But it doesn't check if the destroyed object was an entity, so it can trigger destruction when for example a train is destroyed.
Its fixed by just adding if event.type ~= defines.target_type.entity then return end inside OnObjectDestroyed in control.lua

18 days ago

https://github.com/robot256/cargo_ships/pull/60

made pull request with small conditional bug I found and fix proposed by O5MO

17 days ago

Thank you very much for the report and the fix! This is included in release 1.0.32, along with a migration to fix any corrupted oil rigs in the game.

17 days ago

Cool. Thanks as well :D

New response