1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-28 08:48:48 +02:00

Merge pull request #594 from dydzio0614/HeroSpeedFix

Fix hero/boat speed on adventure map
This commit is contained in:
Alexander Shishkin 2019-05-19 21:49:53 +03:00 committed by GitHub
commit 6ddebfd43e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -770,7 +770,15 @@ void CMapHandler::CMapBlitter::drawObjects(SDL_Surface * targetSurf, const Terra
if (!canDrawObject(obj))
continue;
auto objData = findObjectBitmap(obj, info->anim);
uint8_t animationFrame = info->anim;
if(obj->ID == Obj::HERO) //non-generic animation frame pick for hero and boat
{
animationFrame = info->heroAnim;
const CGHeroInstance * hero = dynamic_cast<const CGHeroInstance *>(obj);
if(hero->boat)
animationFrame /= 2;
}
auto objData = findObjectBitmap(obj, animationFrame);
if (objData.objBitmap)
{
Rect srcRect(object.rect.x, object.rect.y, tileSize, tileSize);