simplify (same code path for LoadFromActorFile)

This commit is contained in:
Glenn Maynard
2005-10-11 00:50:25 +00:00
parent d87cfccfb9
commit 049af2408d
+5 -10
View File
@@ -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:
{