on_circuit_network_deleted, on_circuit_network_merged
Posted: Sat Sep 24, 2022 2:41 am
TL;DR
An event that fires when a circuit network gets removed and an event that fires when two circuit networks get connected (and one of them gets removed)Why ?
There is currently no way but expensive polling to tell if a circuit network(-id) is no longer in use when a mod is saving data for that circuit-network(-id), resulting in a memory leak. The on_circuit_network_merged event is a nice to have as it would be helpful to migrate the data related to the removed network to the merged network, but could be worked around with an implementation of on_circuit_network_deleted, if on_circuit_network_deleted also covers the deletion in case of two networks merging.Signature
Code: Select all
on_circuit_network_deleted
Called when a circuit network gets removed
circuit_network :: LuiCircuitNetwork The circuit network that got removed.
name :: defines.events Identifier of the event.
tick :: uint Tick the event was generated.
on_circuit_network_merged
Called when two circuit networks get connected and one of them has to be removed
merged_circuit_network :: LuiCircuitNetwork The merged circuit network
removed_circuit_network :: LuiCircuitNetwork The circuit network that got removed.
name :: defines.events Identifier of the event.
tick :: uint Tick the event was generated.