simplify
This commit is contained in:
@@ -334,23 +334,26 @@ Actor* ActorUtil::MakeActor( const RString &sPath_, const XNode *pParent, Actor
|
|||||||
if( ft == FT_Directory && sPath.Right(1) != "/" )
|
if( ft == FT_Directory && sPath.Right(1) != "/" )
|
||||||
sPath += '/';
|
sPath += '/';
|
||||||
|
|
||||||
|
if( ft == FT_Directory )
|
||||||
|
{
|
||||||
|
RString sXMLPath = sPath + "default.xml";
|
||||||
|
if( DoesFileExist(sXMLPath) )
|
||||||
|
{
|
||||||
|
sPath = sXMLPath;
|
||||||
|
ft = FT_Xml;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
RString sDir = Dirname( sPath );
|
RString sDir = Dirname( sPath );
|
||||||
switch( ft )
|
switch( ft )
|
||||||
{
|
{
|
||||||
case FT_Directory:
|
case FT_Directory:
|
||||||
{
|
{
|
||||||
sDir = sPath;
|
sDir = sPath;
|
||||||
|
|
||||||
sPath = sDir + "default.xml";
|
|
||||||
if( !DoesFileExist(sPath) )
|
|
||||||
{
|
|
||||||
BGAnimation *pBGA = new BGAnimation;
|
BGAnimation *pBGA = new BGAnimation;
|
||||||
pBGA->LoadFromAniDir( sDir );
|
pBGA->LoadFromAniDir( sDir );
|
||||||
return pBGA;
|
return pBGA;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* fall through */
|
|
||||||
}
|
|
||||||
case FT_Xml:
|
case FT_Xml:
|
||||||
{
|
{
|
||||||
XNode xml;
|
XNode xml;
|
||||||
|
|||||||
Reference in New Issue
Block a user