As I said, the try/catch was just something I added while searching, and the real fix for this particular crash was the check for
genstats.at(j - 1).miltary_strength.empty())
I don't mind either way though. I expect that these cases will mostly come up when loading a savegame, so if the AI decided to attack a bit later because initialization isn't ready, no harm done.
Do we really need the
if (genstats.size()<j) {
As I said, the try/catch was just something I added while searching, and the real fix for this particular crash was the check for
genstats.at(j - 1).miltary_ strength. empty() )
I don't mind either way though. I expect that these cases will mostly come up when loading a savegame, so if the AI decided to attack a bit later because initialization isn't ready, no harm done.