Skip to content

Commit

Permalink
Don't enter an infinite loop on loading invalid stored templates.
Browse files Browse the repository at this point in the history
For some reason, this happened on loading a campaign game twice without a full restart in between.
  • Loading branch information
Cyp committed Jul 29, 2016
1 parent 640f6c2 commit a394991
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/template.cpp
Expand Up @@ -208,12 +208,14 @@ bool initTemplates()
|| (design.numWeaps > 2 && !(asWeaponStats + design.asWeaps[2])->designable))
{
debug(LOG_ERROR, "Template %s from stored templates cannot be designed", design.name.toUtf8().constData());
ini.nextArrayItem();
continue;
}
bool valid = intValidTemplate(&design, ini.value("name").toString().toUtf8().constData(), false, selectedPlayer);
if (!valid)
{
debug(LOG_ERROR, "Invalid template %s from stored templates", design.name.toUtf8().constData());
ini.nextArrayItem();
continue;
}
DROID_TEMPLATE *psDestTemplate = NULL;
Expand Down

0 comments on commit a394991

Please sign in to comment.