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:
commit
6ddebfd43e
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user