Skip to content

Commit

Permalink
Fix ticket:3094 unit designs in factory menu not appearing when savin…
Browse files Browse the repository at this point in the history
…g and loading.
  • Loading branch information
perim committed Feb 1, 2012
1 parent 1759623 commit 6f7e523
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/game.cpp
Expand Up @@ -5407,7 +5407,7 @@ bool loadSaveTemplate(const char *pFileName)
psTemplate->asWeaps[1] = getCompFromName(COMP_WEAPON, ini.value("weapon/2", QString("ZNULLWEAPON")).toString().toUtf8().constData());
psTemplate->asWeaps[2] = getCompFromName(COMP_WEAPON, ini.value("weapon/3", QString("ZNULLWEAPON")).toString().toUtf8().constData());
psTemplate->numWeaps = ini.value("weapons").toInt();

psTemplate->enabled = ini.value("enabled").toBool();
psTemplate->prefab = false; // not AI template

//calculate the total build points
Expand Down Expand Up @@ -5476,6 +5476,7 @@ bool writeTemplateFile(const char *pFileName)
ini.setValue("sensor", (asSensorStats + psCurr->asParts[COMP_SENSOR])->pName);
ini.setValue("construct", (asConstructStats + psCurr->asParts[COMP_CONSTRUCT])->pName);
ini.setValue("weapons", psCurr->numWeaps);
ini.setValue("enabled", psCurr->enabled);
for (int j = 0; j < psCurr->numWeaps; j++)
{
ini.setValue("weapon/" + QString::number(j + 1), (asWeaponStats + psCurr->asWeaps[j])->pName);
Expand Down

1 comment on commit 6f7e523

@johan-boule
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the bugfix!

Please sign in to comment.