Method to prevent certain automatic power pole connections
Posted: Mon Aug 30, 2021 11:40 pm
When a power pole is placed it is automatically connected to some nearby poles. In my mod I want a pole to only automatically connect to certain other types of poles. I do this by listening to the on_build/revive events and then disconnecting the pole from certain neighbours. You can see my implementation here: https://github.com/tburrows13/PowerOver ... lua#L9-L20
My problem is that the electric networks are momentarily joined so they are 'polluted' for 5 seconds (the minimum precision time for accessing usage data). I can see several ways of mitigating this (in rough order of preference):
My problem is that the electric networks are momentarily joined so they are 'polluted' for 5 seconds (the minimum precision time for accessing usage data). I can see several ways of mitigating this (in rough order of preference):
- Add a way to list compatible entities in the power pole prototype
- Don't momentarily merge electric networks if they are disconnected again on the same tick
- Add a prototype flag to disable automatic connections entirely