Browse Source

Added workaround for ~200 ms lag occuring after hero move

Ivan Savenko 2 years ago
parent
commit
9308319ac7
2 changed files with 4 additions and 1 deletions
  1. 3 0
      client/CPlayerInterface.cpp
  2. 1 1
      client/windows/CAdvmapInterface.cpp

+ 3 - 0
client/CPlayerInterface.cpp

@@ -2550,6 +2550,9 @@ void CPlayerInterface::doMoveHero(const CGHeroInstance * h, CGPath path)
 		// (i == 0) means hero went through all the path
 		adventureInt->updateMoveHero(h, (i != 0));
 		adventureInt->updateNextHero(h);
+
+		// ugly workaround to force instant update of adventure map
+		adventureInt->animValHitCount = 8;
 	}
 
 	setMovementStatus(false);

+ 1 - 1
client/windows/CAdvmapInterface.cpp

@@ -1044,7 +1044,7 @@ void CAdvMapInt::show(SDL_Surface * to)
 	{
 		++heroAnim;
 	}
-	if(animValHitCount == 8)
+	if(animValHitCount >= 8)
 	{
 		CGI->mh->updateWater();
 		animValHitCount = 0;