fix tween overflow in Actor commands that call themself
This commit is contained in:
@@ -387,6 +387,9 @@ void Actor::BeginTweening( float time, TweenType tt )
|
|||||||
{
|
{
|
||||||
// initialize the new TS from the last TS in the list
|
// initialize the new TS from the last TS in the list
|
||||||
TS = m_TweenStates[m_TweenStates.size()-2];
|
TS = m_TweenStates[m_TweenStates.size()-2];
|
||||||
|
|
||||||
|
// don't inherit the queued state's command
|
||||||
|
TS.command.Clear();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -908,7 +911,7 @@ void Actor::Sleep( float time )
|
|||||||
BeginTweening( 0, TWEEN_LINEAR );
|
BeginTweening( 0, TWEEN_LINEAR );
|
||||||
}
|
}
|
||||||
|
|
||||||
void Actor::QueueCommand( Command command )
|
void Actor::QueueCommand( const Command& command )
|
||||||
{
|
{
|
||||||
BeginTweening( 0, TWEEN_LINEAR );
|
BeginTweening( 0, TWEEN_LINEAR );
|
||||||
DestTweenState().command = command;
|
DestTweenState().command = command;
|
||||||
|
|||||||
@@ -182,7 +182,7 @@ public:
|
|||||||
void BeginTweening( float time, TweenType tt = TWEEN_LINEAR );
|
void BeginTweening( float time, TweenType tt = TWEEN_LINEAR );
|
||||||
void StopTweening();
|
void StopTweening();
|
||||||
void Sleep( float time );
|
void Sleep( float time );
|
||||||
void QueueCommand( Command command );
|
void QueueCommand( const Command& command );
|
||||||
virtual void FinishTweening();
|
virtual void FinishTweening();
|
||||||
virtual void HurryTweening( float factor );
|
virtual void HurryTweening( float factor );
|
||||||
// Let ActorFrame and BGAnimation override
|
// Let ActorFrame and BGAnimation override
|
||||||
|
|||||||
@@ -14,6 +14,8 @@ public:
|
|||||||
|
|
||||||
CString GetName() const; // the command name is the first argument in all-lowercase
|
CString GetName() const; // the command name is the first argument in all-lowercase
|
||||||
|
|
||||||
|
void Clear() { m_vsArgs.clear(); }
|
||||||
|
|
||||||
struct Arg
|
struct Arg
|
||||||
{
|
{
|
||||||
CString s;
|
CString s;
|
||||||
|
|||||||
Reference in New Issue
Block a user