Fix crash on opening empty production menu after loading savegame containing commander templates.

Introduced in 9474ae3715.

Fixes ticket:2968.
master
Cyp 2011-12-08 20:40:14 +01:00
parent 4bf70ca7c5
commit d1e2f1a2cb
1 changed files with 2 additions and 2 deletions

View File

@ -6853,8 +6853,8 @@ UBYTE checkProductionForCommand(UBYTE player)
for (unsigned factoryInc = 0; factoryInc < factoryNumFlag[player][factoryType].size(); ++factoryInc)
{
//check to see if there is a factory
if (factoryNumFlag[player][factoryType][factoryInc])
//check to see if there is a factory with a production run
if (factoryNumFlag[player][factoryType][factoryInc] && factoryInc < asProductionRun[factoryType].size())
{
ProductionRun &productionRun = asProductionRun[factoryType][factoryInc];
for (unsigned inc = 0; inc < productionRun.size(); ++inc)