Reset sprite state when setting new state properties.

This commit is contained in:
Kyzentun
2015-01-13 04:27:52 -07:00
parent b2ceb184fa
commit 259ef96493
2 changed files with 5 additions and 1 deletions
+4
View File
@@ -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
View File
@@ -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;