Add power switch to the LuaEntity::neighbours

xmnovotny
Burner Inserter
Burner Inserter
Posts: 18
Joined: Wed Jun 29, 2016 7:47 am
Contact:

Add power switch to the LuaEntity::neighbours

Post by xmnovotny »

I have started to implement some statistic features for electricity network (such as max. available power, max. consumption, stored energy and so on) and I need to get all entities connected to the one network. I can already get all poles in the network using LueEntity::neighbours unless there is a power switch - just because I can't get connected power switches via Lua script.
So in would be nice, if the power switch will be added to the LueEntity::neighbours structure.

And the another thing, there could be a new method/variable in the "pole type" LuaEnity, that returns all entities powered by that pole (or just make "supply_area_distance" from prototype accessible via Lua).
Post Reply

Return to “Implemented mod requests”