From 2a16238734ccfd9192b8fa35458a415e24dcc099 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Mon, 29 Aug 2005 05:01:34 +0000 Subject: [PATCH] more convenient: input as attrib, not child --- stepmania/src/Actor.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/stepmania/src/Actor.cpp b/stepmania/src/Actor.cpp index 5a34506067..498dd4a27e 100644 --- a/stepmania/src/Actor.cpp +++ b/stepmania/src/Actor.cpp @@ -181,19 +181,15 @@ void Actor::LoadFromNode( const CString& sDir, const XNode* pNode ) // Load Name, if any. pNode->GetAttrValue( "Name", m_sName ); - FOREACH_CONST_Child( pNode, pChild ) + FOREACH_CONST_Attr( pNode, pChild ) { if( pChild->m_sName == "Input" ) { /* Parameters are set as globals by ActorUtil::LoadFromActorFile. * If parameters are specified here, save them to the actor. Accessing * parameters as globals directly is deprecated. */ - CString sName; - if( !pChild->GetAttrValue( "Name", sName ) ) - { - RageException::Throw( ssprintf("Input node in '%s' is missing the attribute 'Name'", sDir.c_str()) ); - } - + const CString &sName = pChild->m_sValue; + Lua *L = LUA->Get(); this->PushSelf( L ); LuaHelpers::Push( sName, L );