Closed LaTrissTitude closed 6 years ago
Thanks for the report, I will attempt to fix that case. It looks like the value "squad.mostRecentUnitGroupRemovalTick[key]" was nil for this squad being processed, for whatever reason. I will add some extra value checking which should stop that from happening, but i'm not sure what would cause that situation and why it doesn't happen more often (this is the first time i've seen this issue, code has not changed for a long time now in that section)
Have you had this issue again? Is there any way I can reproduce this better? I guess trying to make a map with no biters alive and have some squads sitting idle. I'll try to do this now.
Got this twice today:
Error while running event robotarmy::on_tick (ID 0) robotarmy/robolib/Squad.lua:658: attempt to perform arithmetic on field '?' (a nil value)
Same map, so it's weird since I reloaded the auto-save and it then ran twenty minutes til crashing (auto-save interval the default five minutes). Something really weird going on.
Oh, and first time IIRC that I got this, never before (I think, but it's been a while since I last actually used the army, I only had the mod loaded).
thanks, i'll be putting a guard around that line and trying to avoid it crashing the game at least - not sure what situations can actually cause this yet, but the first step to fixing this is to prevent full-on crashes/script errors for the users. If a squad has a logic break it's not the end of the world...
I'm closing this, because i'll do the code change right now!
All my robots were waiting due to every biters being dead in a large perimeter, I was doing something totally unrelated (making modular rail system blueprints) when the map crashed and thrown me on the main menu.
Here is the error shown by the game log: 5431.487 Error MainLoop.cpp:1013: Exception at tick 3265447: Error while running event robotarmy::on_tick (ID 0) robotarmy/robolib/Squad.lua:658: attempt to perform arithmetic on field '?' (a nil value)