diff --git a/common/lc_application.cpp b/common/lc_application.cpp index 11a9c9d7..b150e435 100644 --- a/common/lc_application.cpp +++ b/common/lc_application.cpp @@ -107,7 +107,7 @@ bool lcApplication::LoadPiecesLibrary(const char* LibPath, const char* LibraryIn if (mLibrary->Load(LibraryPath, LibraryCachePath)) { - mLibrary->mNumOfficialPieces = mLibrary->mPieces.GetSize(); + mLibrary->SetOfficialPieces(); return true; } } @@ -468,4 +468,4 @@ void lcApplication::ShowPreferencesDialog() */ lcGetActiveProject()->UpdateAllViews(); -} \ No newline at end of file +} diff --git a/common/lc_library.h b/common/lc_library.h index 4b6ac546..7a90acf6 100644 --- a/common/lc_library.h +++ b/common/lc_library.h @@ -121,6 +121,12 @@ public: void GetCategoryEntries(int CategoryIndex, bool GroupPieces, lcArray& SinglePieces, lcArray& GroupedPieces); void GetPatternedPieces(PieceInfo* Parent, lcArray& Pieces) const; + void SetOfficialPieces() + { + if (mZipFile) + mNumOfficialPieces = mPieces.GetSize(); + } + lcArray mPieces; lcArray mPrimitives; int mNumOfficialPieces;