[Rseding91] [0.17.79] Unable to iterate over a full table of forces.
Posted: Mon May 18, 2020 8:09 am
The game crashes when attempting to iterate over the "game.forces" table if the maximum of 63 forces has been reached. I ran into this bug when using the API to add all forces in a game to a list-box element.
To reproduce this in a fresh 'Freeplay' scenario (via the console) create the max. number of forces then iterate over them.
I also wondered if it was just the name value that was causing an issue, but it also crashes the game if you run the following...
You are able to iterate over the table as long as you haven't reached the maximum number of forces; tested by only creating 59 forces and less.
To reproduce this in a fresh 'Freeplay' scenario (via the console) create the max. number of forces then iterate over them.
Code: Select all
/c for i=0,60 do game.create_force(i) end
/c for k, v in pairs(game.forces) do game.players[1].print(v.name) end
Code: Select all
/c for k, v in pairs(game.forces) do v.reset() end