Fixed crash using the --stud-style option.

This commit is contained in:
Leonardo Zide
2021-01-22 13:59:36 -08:00
parent 590cce8a77
commit 0c03fd3fea
2 changed files with 5 additions and 5 deletions
+2 -5
View File
@@ -655,12 +655,7 @@ lcCommandLineOptions lcApplication::ParseCommandLineOptions()
}
}
else if (Option == QLatin1String("-ss") || Option == QLatin1String("--stud-style"))
{
ParseInteger(Options.StudStyle, 0, 7);
if (Options.StudStyle != lcGetProfileInt(LC_PROFILE_STUD_STYLE))
lcGetPiecesLibrary()->SetStudStyle(Options.StudStyle, false);
}
else if (Option == QLatin1String("-obj") || Option == QLatin1String("--export-wavefront"))
{
Options.SaveWavefront = true;
@@ -835,6 +830,8 @@ lcStartupMode lcApplication::Initialize(const QList<QPair<QString, bool>>& Libra
}
}
lcGetPiecesLibrary()->SetStudStyle(Options.StudStyle, false);
if (!SaveAndExit)
gMainWindow->CreateWidgets();
+3
View File
@@ -1536,6 +1536,9 @@ bool lcPiecesLibrary::SupportsStudStyle() const
void lcPiecesLibrary::SetStudStyle(int StudStyle, bool Reload)
{
if (mStudStyle == StudStyle)
return;
mStudStyle = StudStyle;
LoadColors();