more convenient: input as attrib, not child
This commit is contained in:
@@ -181,18 +181,14 @@ void Actor::LoadFromNode( const CString& sDir, const XNode* pNode )
|
|||||||
// Load Name, if any.
|
// Load Name, if any.
|
||||||
pNode->GetAttrValue( "Name", m_sName );
|
pNode->GetAttrValue( "Name", m_sName );
|
||||||
|
|
||||||
FOREACH_CONST_Child( pNode, pChild )
|
FOREACH_CONST_Attr( pNode, pChild )
|
||||||
{
|
{
|
||||||
if( pChild->m_sName == "Input" )
|
if( pChild->m_sName == "Input" )
|
||||||
{
|
{
|
||||||
/* Parameters are set as globals by ActorUtil::LoadFromActorFile.
|
/* Parameters are set as globals by ActorUtil::LoadFromActorFile.
|
||||||
* If parameters are specified here, save them to the actor. Accessing
|
* If parameters are specified here, save them to the actor. Accessing
|
||||||
* parameters as globals directly is deprecated. */
|
* parameters as globals directly is deprecated. */
|
||||||
CString sName;
|
const CString &sName = pChild->m_sValue;
|
||||||
if( !pChild->GetAttrValue( "Name", sName ) )
|
|
||||||
{
|
|
||||||
RageException::Throw( ssprintf("Input node in '%s' is missing the attribute 'Name'", sDir.c_str()) );
|
|
||||||
}
|
|
||||||
|
|
||||||
Lua *L = LUA->Get();
|
Lua *L = LUA->Get();
|
||||||
this->PushSelf( L );
|
this->PushSelf( L );
|
||||||
|
|||||||
Reference in New Issue
Block a user