From dfce58ed985676223b06d3757dcfbdf7aac42fa9 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Wed, 23 Feb 2005 00:22:23 +0000 Subject: [PATCH] fix commands being parsed multiple times; eg. OnCommand=@'"x," .. foo()' can only run foo() once --- stepmania/src/ActorUtil.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/stepmania/src/ActorUtil.cpp b/stepmania/src/ActorUtil.cpp index e971b27875..11411669fa 100644 --- a/stepmania/src/ActorUtil.cpp +++ b/stepmania/src/ActorUtil.cpp @@ -91,6 +91,7 @@ Actor* ActorUtil::LoadFromActorFile( const CString& sAniDir, const XNode* pNode BGAnimation *p = new BGAnimation; p->LoadFromNode( sAniDir, pNode ); pActor = p; + return pActor; // we just ran LoadFromNode; don't run it again below } else if( sType == "GenreDisplay" || @@ -104,6 +105,7 @@ Actor* ActorUtil::LoadFromActorFile( const CString& sAniDir, const XNode* pNode ActorFrame *p = new ActorFrame; p->LoadFromNode( sAniDir, pNode ); pActor = p; + return pActor; // we just ran LoadFromNode; don't run it again below } else if( sType == "BitmapText" ) { @@ -293,6 +295,7 @@ retry: ASSERT( pActor ); // we should have filled this in above // TODO: LoadFromNode should be called when we still have a pointer to the derived type. + // (Why isn't it virtual?) pActor->LoadFromNode( sAniDir, pNode ); return pActor;