File tree Expand file tree Collapse file tree 2 files changed +23
-16
lines changed Expand file tree Collapse file tree 2 files changed +23
-16
lines changed Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ bool LDLMainModel::load(const char *filename)
87
87
{
88
88
LDrawIniComputeRealDirs (sm_lDrawIni, 1 , 0 , filename);
89
89
}
90
- if (! strlen (lDrawDir ()))
90
+ if (strlen (lDrawDir ()) == 0 && LDLModel::sm_ldrawZipPath. empty ( ))
91
91
{
92
92
ldrawDirNotFound ();
93
93
return false ;
Original file line number Diff line number Diff line change @@ -888,29 +888,36 @@ bool LDLModel::initializeNewSubModel(
888
888
// NOTE: static function.
889
889
bool LDLModel::verifyLDrawDir (const char *value)
890
890
{
891
- char currentDir[1024 ];
892
- bool retValue = false ;
893
-
894
- if (value && getcwd (currentDir, sizeof (currentDir)))
891
+ if (strlen (value) > 0 )
895
892
{
896
- if (chdir (value) == 0 )
893
+ char currentDir[1024 ];
894
+ bool retValue = false ;
895
+
896
+ if (value && getcwd (currentDir, sizeof (currentDir)))
897
897
{
898
- if (!sm_verifyLDrawSubDirs || ( chdir (" parts " ) == 0 && chdir ( " .. " ) == 0 && chdir ( " p " ) == 0 ) )
898
+ if (chdir (value ) == 0 )
899
899
{
900
- retValue = true ;
900
+ if (!sm_verifyLDrawSubDirs || (chdir (" parts" ) == 0 && chdir (" .." ) == 0 && chdir (" p" ) == 0 ))
901
+ {
902
+ retValue = true ;
903
+ }
901
904
}
902
- }
903
- if (chdir (currentDir) != 0 )
904
- {
905
- debugPrintf (" Error going back to original directory.\n " );
906
- debugPrintf (" currentDir before: <%s>\n " , currentDir);
907
- if (getcwd (currentDir, sizeof (currentDir)) != NULL )
905
+ if (chdir (currentDir) != 0 )
908
906
{
909
- debugPrintf (" currentDir after: <%s>\n " , currentDir);
907
+ debugPrintf (" Error going back to original directory.\n " );
908
+ debugPrintf (" currentDir before: <%s>\n " , currentDir);
909
+ if (getcwd (currentDir, sizeof (currentDir)) != NULL )
910
+ {
911
+ debugPrintf (" currentDir after: <%s>\n " , currentDir);
912
+ }
910
913
}
911
914
}
915
+ return retValue;
916
+ }
917
+ else
918
+ {
919
+ return checkLDrawZipPath (sm_ldrawZipPath.c_str ());
912
920
}
913
- return retValue;
914
921
}
915
922
916
923
// NOTE: static function.
You can’t perform that action at this time.
0 commit comments