RailPowerSystem

by Hermios

Connect rails to electric and signals circuits, and use electric trains

Content
10 days ago
0.14 - 1.1
446
Transportation

b Error while running event RailPowerSystem::on_robot_built_entity

5 years ago

Hi,
I get the following message when a track is destroyed by aliens and rebuilt by a robot.

Error while running event RailPowerSystem::on_robot_built_entity (ID 14)
LuaEntity API call when LuaEntity was invalid.
stack traceback:
RailPowerSystem/libs/entityLibs.lua:3: in function 'distance'
RailPowerSystem/methods/railFunctions.lua:22: in function 'connectCloserNodes'
RailPowerSystem/methods/railFunctions.lua:115: in function 'connectToOtherRails'
RailPowerSystem/methods/globalEvents.lua:37: in function 'OnBuilt'
RailPowerSystem/control.lua:42: in function <RailPowerSystem/control.lua:37>

What can i do to prevent this?
Thank you

5 years ago

Hi Callya
"What can i do to prevent this?"--> Nothing! :) This is not your job, but mine
I will fix it for the next version. I cannot do this now, as there shall be a new release very soon. Sorry, you will have to wait.
In the worst case, you can go to the console and type:
/c for _,entity in pairs(game.surfaces[1].find_entities_filtered{name="electric-node"} do if entity.valid=false then entity.destroy() end end
But you may have a crash by doing so (I didn't test it).
Sorry that I cannot help further for now
Niko

New response