mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-28 08:48:48 +02:00
Merge pull request #596 from dydzio0614/HeroSpeedFix2
Re-fix map hero movement speed, was too fast on land
This commit is contained in:
commit
4acec00aea
@ -770,14 +770,12 @@ void CMapHandler::CMapBlitter::drawObjects(SDL_Surface * targetSurf, const Terra
|
|||||||
if (!canDrawObject(obj))
|
if (!canDrawObject(obj))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
uint8_t animationFrame = info->anim;
|
uint8_t animationFrame;
|
||||||
if(obj->ID == Obj::HERO) //non-generic animation frame pick for hero and boat
|
if(obj->ID == Obj::HERO) //non-generic animation frame pick for hero and boat
|
||||||
{
|
|
||||||
animationFrame = info->heroAnim;
|
animationFrame = info->heroAnim;
|
||||||
const CGHeroInstance * hero = dynamic_cast<const CGHeroInstance *>(obj);
|
else
|
||||||
if(hero->boat)
|
animationFrame = info->anim;
|
||||||
animationFrame /= 2;
|
|
||||||
}
|
|
||||||
auto objData = findObjectBitmap(obj, animationFrame);
|
auto objData = findObjectBitmap(obj, animationFrame);
|
||||||
if (objData.objBitmap)
|
if (objData.objBitmap)
|
||||||
{
|
{
|
||||||
|
@ -1029,6 +1029,11 @@ void CAdvMapInt::show(SDL_Surface * to)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
++animValHitCount; //for animations
|
++animValHitCount; //for animations
|
||||||
|
|
||||||
|
if(animValHitCount % 2 == 0)
|
||||||
|
{
|
||||||
|
++heroAnim;
|
||||||
|
}
|
||||||
if(animValHitCount == 8)
|
if(animValHitCount == 8)
|
||||||
{
|
{
|
||||||
CGI->mh->updateWater();
|
CGI->mh->updateWater();
|
||||||
@ -1036,7 +1041,6 @@ void CAdvMapInt::show(SDL_Surface * to)
|
|||||||
++anim;
|
++anim;
|
||||||
updateScreen = true;
|
updateScreen = true;
|
||||||
}
|
}
|
||||||
++heroAnim;
|
|
||||||
|
|
||||||
if(swipeEnabled)
|
if(swipeEnabled)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user