Reset sprite state when setting new state properties.
This commit is contained in:
@@ -1127,6 +1127,10 @@ public:
|
||||
}
|
||||
vector<Sprite::State> new_states;
|
||||
size_t num_states= lua_objlen(L, 1);
|
||||
if(num_states == 0)
|
||||
{
|
||||
luaL_error(L, "A Sprite cannot have zero states.");
|
||||
}
|
||||
for(size_t s= 0; s < num_states; ++s)
|
||||
{
|
||||
Sprite::State new_state;
|
||||
|
||||
+1
-1
@@ -57,7 +57,7 @@ public:
|
||||
virtual float GetAnimationLengthSeconds() const;
|
||||
virtual void SetSecondsIntoAnimation( float fSeconds );
|
||||
void SetStateProperties(const vector<State>& new_states)
|
||||
{ m_States= new_states; }
|
||||
{ m_States= new_states; SetState(0); }
|
||||
|
||||
RString GetTexturePath() const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user