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;