cleanup
This commit is contained in:
@@ -173,22 +173,6 @@ Actor* ActorUtil::LoadFromActorFile( const CString& sDir, const XNode* pNode )
|
|||||||
if( !bHasClass )
|
if( !bHasClass )
|
||||||
bHasClass = pNode->GetAttrValue( "Type", sClass ); // for backward compatibility
|
bHasClass = pNode->GetAttrValue( "Type", sClass ); // for backward compatibility
|
||||||
|
|
||||||
CString sFile;
|
|
||||||
if( pNode->GetAttrValue( "File", sFile ) )
|
|
||||||
{
|
|
||||||
if( sFile == "" )
|
|
||||||
{
|
|
||||||
CString sError = ssprintf( "The actor file in '%s' has a blank, invalid File attribute \"%s\"",
|
|
||||||
sDir.c_str(), sClass.c_str() );
|
|
||||||
RageException::Throw( sError );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
LuaHelpers::RunAtExpressionS( sFile );
|
|
||||||
bool bIsAbsolutePath = sFile.Left(1) == "/";
|
|
||||||
FixSlashesInPlace( sFile );
|
|
||||||
|
|
||||||
// backward compat hack
|
// backward compat hack
|
||||||
if( !bHasClass )
|
if( !bHasClass )
|
||||||
{
|
{
|
||||||
@@ -206,6 +190,7 @@ Actor* ActorUtil::LoadFromActorFile( const CString& sDir, const XNode* pNode )
|
|||||||
else if( sClass == "SongBackground" )
|
else if( sClass == "SongBackground" )
|
||||||
{
|
{
|
||||||
Song *pSong = GAMESTATE->m_pCurSong;
|
Song *pSong = GAMESTATE->m_pCurSong;
|
||||||
|
CString sFile;
|
||||||
if( pSong && pSong->HasBackground() )
|
if( pSong && pSong->HasBackground() )
|
||||||
sFile = pSong->GetBackgroundPath();
|
sFile = pSong->GetBackgroundPath();
|
||||||
else
|
else
|
||||||
@@ -236,8 +221,15 @@ Actor* ActorUtil::LoadFromActorFile( const CString& sDir, const XNode* pNode )
|
|||||||
else // sClass is empty or garbage (e.g. "1" // 0==Sprite")
|
else // sClass is empty or garbage (e.g. "1" // 0==Sprite")
|
||||||
{
|
{
|
||||||
// automatically figure out the type
|
// automatically figure out the type
|
||||||
|
CString sFile;
|
||||||
|
pNode->GetAttrValue( "File", sFile );
|
||||||
|
|
||||||
|
LuaHelpers::RunAtExpressionS( sFile );
|
||||||
|
bool bIsAbsolutePath = sFile.Left(1) == "/";
|
||||||
|
FixSlashesInPlace( sFile );
|
||||||
|
|
||||||
/* Be careful: if sFile is "", and we don't check it, then we can end up recursively
|
/* Be careful: if sFile is "", and we don't check it, then we can end up recursively
|
||||||
* loading the BGAnimationLayer that we're in. */
|
* loading the layer we're in. */
|
||||||
if( sFile == "" )
|
if( sFile == "" )
|
||||||
{
|
{
|
||||||
CString sError = ssprintf( "The actor file in '%s' is missing the File attribute or has an invalid Class \"%s\"",
|
CString sError = ssprintf( "The actor file in '%s' is missing the File attribute or has an invalid Class \"%s\"",
|
||||||
|
|||||||
Reference in New Issue
Block a user