AlexVinS 8 years ago
parent
commit
c30d9f2fd6
1 changed files with 10 additions and 9 deletions
  1. 10 9
      client/battle/CCreatureAnimation.cpp

+ 10 - 9
client/battle/CCreatureAnimation.cpp

@@ -154,7 +154,13 @@ CCreatureAnimation::CCreatureAnimation(const std::string & name_, TSpeedControll
 	//todo: optimize
 	forward->preload();
 	reverse->preload();
-	reverse->verticalFlip();
+
+	// if necessary, add one frame into vcmi-only group DEAD
+	if(forward->size(CCreatureAnim::DEAD) == 0)
+	{
+		forward->duplicateImage(CCreatureAnim::DEATH, forward->size(CCreatureAnim::DEATH)-1, CCreatureAnim::DEAD);
+		reverse->duplicateImage(CCreatureAnim::DEATH, reverse->size(CCreatureAnim::DEATH)-1, CCreatureAnim::DEAD);
+	}
 
 	//TODO: get dimensions form CAnimation
 	IImage * first = forward->getImage(0, type, true);
@@ -168,12 +174,7 @@ CCreatureAnimation::CCreatureAnimation(const std::string & name_, TSpeedControll
 	fullWidth = first->width();
 	fullHeight = first->height();
 
-	// if necessary, add one frame into vcmi-only group DEAD
-	if(forward->size(CCreatureAnim::DEAD) == 0)
-	{
-		forward->duplicateImage(CCreatureAnim::DEATH, forward->size(CCreatureAnim::DEATH)-1, CCreatureAnim::DEAD);
-		reverse->duplicateImage(CCreatureAnim::DEATH, reverse->size(CCreatureAnim::DEATH)-1, CCreatureAnim::DEAD);
-	}
+	reverse->verticalFlip();
 
 	play();
 }
@@ -327,8 +328,8 @@ void CCreatureAnimation::pause()
 
 void CCreatureAnimation::play()
 {
-	logAnim->trace("Play %s group %d at %d:%d", name, static_cast<int>(getType()), pos.x, pos.y);
+	//logAnim->trace("Play %s group %d at %d:%d", name, static_cast<int>(getType()), pos.x, pos.y);
     speed = 0;
-    if (speedController(this, type) != 0)
+    if(speedController(this, type) != 0)
         speed = 1 / speedController(this, type);
 }