simplify
This commit is contained in:
@@ -247,22 +247,20 @@ Actor* ActorUtil::MakeActor( const CString &sPath )
|
|||||||
sDir += '/';
|
sDir += '/';
|
||||||
|
|
||||||
CString sXml = sDir + "default.xml";
|
CString sXml = sDir + "default.xml";
|
||||||
if( DoesFileExist(sXml) )
|
if( !DoesFileExist(sXml) )
|
||||||
{
|
|
||||||
XNode xml;
|
|
||||||
if( !xml.LoadFromFile(sXml) )
|
|
||||||
{
|
|
||||||
// XNode will warn about the error
|
|
||||||
return new Actor;
|
|
||||||
}
|
|
||||||
return LoadFromActorFile( sDir, &xml );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
BGAnimation *pBGA = new BGAnimation;
|
BGAnimation *pBGA = new BGAnimation;
|
||||||
pBGA->LoadFromAniDir( sDir );
|
pBGA->LoadFromAniDir( sDir );
|
||||||
return pBGA;
|
return pBGA;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
XNode xml;
|
||||||
|
if( !xml.LoadFromFile(sXml) )
|
||||||
|
{
|
||||||
|
// XNode will warn about the error
|
||||||
|
return new Actor;
|
||||||
|
}
|
||||||
|
return LoadFromActorFile( sDir, &xml );
|
||||||
}
|
}
|
||||||
case FT_Xml:
|
case FT_Xml:
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user