From 206f731d7985c84de3d924d4a32c27dd12bc35bf Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Mon, 9 Oct 2006 05:18:17 +0000 Subject: [PATCH] simplify --- stepmania/src/ActorUtil.cpp | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/stepmania/src/ActorUtil.cpp b/stepmania/src/ActorUtil.cpp index 48798cda84..0d45eea3d4 100644 --- a/stepmania/src/ActorUtil.cpp +++ b/stepmania/src/ActorUtil.cpp @@ -334,22 +334,25 @@ Actor* ActorUtil::MakeActor( const RString &sPath_, const XNode *pParent, Actor 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; + } + } + RString sDir = Dirname( sPath ); switch( ft ) { case FT_Directory: { sDir = sPath; - - sPath = sDir + "default.xml"; - if( !DoesFileExist(sPath) ) - { - BGAnimation *pBGA = new BGAnimation; - pBGA->LoadFromAniDir( sDir ); - return pBGA; - } - - /* fall through */ + BGAnimation *pBGA = new BGAnimation; + pBGA->LoadFromAniDir( sDir ); + return pBGA; } case FT_Xml: {