Event for entity status change
Posted: Thu Oct 24, 2019 11:33 am
I think the current API is missing an on_entity_status_changed event which should listen for changes in LuaEntity.status.
The event should pass the entity (with the new status) and the old status.
This would remove the necessity of mods checking any of the entity statuses using the expensive on_tick event.
One mod in particular that comes to mind is Bottleneck that does mass-checking of entity states on tick and is quite UPS heavy as a result or is forced to slow down updates.
The downside to doing this would be a considerable increase in function calls for megabases though no clue on what the impact would be from the base game code.
Let me know what you think.
The event should pass the entity (with the new status) and the old status.
This would remove the necessity of mods checking any of the entity statuses using the expensive on_tick event.
One mod in particular that comes to mind is Bottleneck that does mass-checking of entity states on tick and is quite UPS heavy as a result or is forced to slow down updates.
The downside to doing this would be a considerable increase in function calls for megabases though no clue on what the impact would be from the base game code.
Let me know what you think.