kyranf / robotarmyfactorio

A mod to add robot troop units and perhaps associated support buildings and items to produce and control them.
MIT License
35 stars 12 forks source link

Multiplayer game fails with "Error while running event robotarmy::on_built_entity" #122

Closed blubFisch closed 6 years ago

blubFisch commented 6 years ago

Nice mod, good job!

When I'm placing the Droid Assembler in the vanilla pvp multiplayer scenario, it crashes with

Error while running event robotarmy::on_built_entity (ID 6) robotarmy/robolib/robotarmyhelpers.lua:566: attempt to index field '?' (a nil value)

I couldn't reproduce it when I loaded the game in singleplayer. In another multiplayer game (without other mods), it worked.

kyranf commented 6 years ago

interesting, i'll check it out thanks for the bug report.

It looks like the "global.AssemblerNearestEnemies[force.name]" table is never created in the case where your error occurred, but DID happen in some other cases - so the initializers are inconsistent. I'll add a check to the table access to see if it's empty first and this should fix your problem.

kyranf commented 6 years ago

Your bug has been fixed in 0.3.4

blubFisch commented 6 years ago

Thanks, haven't had it since.