diff --git a/stepmania/src/ActorUtil.cpp b/stepmania/src/ActorUtil.cpp index 968fd5e5f8..9c81968541 100644 --- a/stepmania/src/ActorUtil.cpp +++ b/stepmania/src/ActorUtil.cpp @@ -103,6 +103,23 @@ retry: sPath = asPaths[0]; } + if( ft == RageFileManager::TYPE_DIR ) + { + RString sXMLPath = sPath + "/default.xml"; + if( DoesFileExist(sXMLPath) ) + { + sPath = sXMLPath; + return true; + } + + RString sLuaPath = sPath + "/default.lua"; + if( DoesFileExist(sLuaPath) ) + { + sPath = sLuaPath; + return true; + } + } + sPath = DerefRedir( sPath ); return true; } @@ -356,26 +373,6 @@ Actor* ActorUtil::MakeActor( const RString &sPath_, Actor *pParentActor, const X if( ft == FT_Directory && sPath.Right(1) != "/" ) sPath += '/'; - if( ft == FT_Directory ) - { - RString sXMLPath = sPath + "default.xml"; - if( DoesFileExist(sXMLPath) ) - { - sPath = sXMLPath; - ft = FT_Xml; - } - } - - if( ft == FT_Directory ) - { - RString sLuaPath = sPath + "default.lua"; - if( DoesFileExist(sLuaPath) ) - { - sPath = sLuaPath; - ft = FT_Lua; - } - } - switch( ft ) { case FT_Xml: diff --git a/stepmania/src/ThemeManager.cpp b/stepmania/src/ThemeManager.cpp index 08148ae700..528eae496c 100644 --- a/stepmania/src/ThemeManager.cpp +++ b/stepmania/src/ThemeManager.cpp @@ -593,6 +593,20 @@ try_element_again: if( bDirIsEmpty ) continue; #endif + + RString sXMLPath = asPaths[p] + "/default.xml"; + if( DoesFileExist(sXMLPath) ) + { + asElementPaths.push_back( sXMLPath ); + break; + } + + RString sLuaPath = asPaths[p] + "/default.lua"; + if( DoesFileExist(sLuaPath) ) + { + asElementPaths.push_back( sLuaPath ); + break; + } } if( ext == asset_masks[i] || !strcmp(asset_masks[i], "*") )