Re: Industry behaviour
Reply #10 –
Well actually, ****uming industries can get along with their own carts and lorries, that would mean I could deliver iron & coal to steel mill and the produced steel would just "vanish" by their own carts and lorries.
If vanishing industry is a problem in terms of not having enough things to connect, then go for the 'replace' option. Unused/uncared industry swapped for something else. It could be worse, it could be better. Considering it was a 'bad industry' to begin with, with great likelihood new one is better. I'm not sure how removing an industry can be hard though.
Case 1: 3 oil wells providing for 1 refinery. 2 is enough to reach maximum needed so 3rd is never used unless some new chain spawns. Despawn the unused oilwell after a long time, connection to refinery removed. Doesn't mess up anything.
Case 2: Sawmill somewhere far is unattended along with couple tree plantations providing wood for it. It goes bankrupt and is removed. One of the tree plantations was only connected to this sawmill, so it gets removed as well. Other one has other consumers so it stays. Sawmill was providing for a furniture factory, and was its only provide. Furniture factory gets removed. Furniture factory is connected to a bunch of things, but recursively going through everything removes all the unlinked industries leaving only intact chains (one-by-one industry spawner would fix broken chains so despawning just a single industry would also be viable). Bunch of pseudo:
removeIndustry() {
foreach (prod, producers) {
removeProducer(prod);
prod.removeConsumer(this);
if (!prod.connected()) prod.removeIndustry();
}
foreach (con, consumers) {
removeConsumer(con);
con.removeProducer(this);
if (!con.connected()) con.removeIndustry();
}
}
Is that really a nightmare?