From 049af2408d40174e9424de4d34e169a469919fb1 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Tue, 11 Oct 2005 00:50:25 +0000 Subject: [PATCH] simplify (same code path for LoadFromActorFile) --- stepmania/src/ActorUtil.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/stepmania/src/ActorUtil.cpp b/stepmania/src/ActorUtil.cpp index d7d77e0dc0..4a859772de 100644 --- a/stepmania/src/ActorUtil.cpp +++ b/stepmania/src/ActorUtil.cpp @@ -235,8 +235,9 @@ all_done: return pReturn; } -Actor* ActorUtil::MakeActor( const CString &sPath ) +Actor* ActorUtil::MakeActor( const CString &sPath_ ) { + CString sPath( sPath_ ); FileType ft = GetFileType( sPath ); switch( ft ) { @@ -246,21 +247,15 @@ Actor* ActorUtil::MakeActor( const CString &sPath ) if( sDir.Right(1) != "/" ) sDir += '/'; - CString sXml = sDir + "default.xml"; - if( !DoesFileExist(sXml) ) + sPath = sDir + "default.xml"; + if( !DoesFileExist(sPath) ) { BGAnimation *pBGA = new BGAnimation; pBGA->LoadFromAniDir( sDir ); return pBGA; } - XNode xml; - if( !xml.LoadFromFile(sXml) ) - { - // XNode will warn about the error - return new Actor; - } - return LoadFromActorFile( sDir, &xml ); + /* fall through */ } case FT_Xml: {