0ptera / Logistic-Train-Network

Factorio mod adding logistic network for trains.
Other
155 stars 55 forks source link

If a stop dies, turn the lamp and combinator into ghosts #307

Closed Quezler closed 1 year ago

Quezler commented 1 year ago

Currently when a stop falls victim of a biter attack (or gets nuked by a space exploration weapon delivery cannon 🙃) the construction robots happily rebuild the stop, but sadly it won't have any of the wire automatically reconnected.

This pull request will make it so that if the train stop entity dies a ghosts = true property will propogate through the functions and have the input & outputs die instead, causing them to turn into ghosts if the force has it enabled, the other ways the entity can cease to exist keep the normal/nil ghost behavior of destroying them all instead.

(of course the ghosts from.die() preserve their wires & the station create listener already revives any lamp ghosts)

The name is of course up for debate, i wasn't sure which you would prefer:

This problem happened before when i was looking, but today i noticed stuck production lines since 1 station was down.

0ptera commented 1 year ago

Never mind my changes, I missed the different calls for mined and script destroy. Your version should work fine.

Quezler commented 1 year ago

Glad you like this suggested change, a hacktoberfest-accepted label would be appreciated on this, but not required. ^-^