more work on the forest level
[supertux.git] / lib / special / sprite.cpp
index 6ae6598..48aa325 100644 (file)
@@ -34,7 +34,9 @@ namespace SuperTux
 Sprite::Sprite(SpriteData& newdata)
   : data(newdata), frame(0), animation_loops(-1)
 {
-  action = data.actions.begin()->second;
+  action = data.get_action("normal");
+  if(!action)
+    action = data.actions.begin()->second;
   last_ticks = SDL_GetTicks();
 }
 
@@ -87,7 +89,7 @@ Sprite::update()
 
   frame += frame_inc;
 
-  if(frame > get_frames()) {
+  if(frame >= get_frames()) {
     frame = fmodf(frame+get_frames(), get_frames());
     
     animation_loops--;