mirror of
https://github.com/vcmi/vcmi.git
synced 2025-07-13 01:20:34 +02:00
Fix hero/boat speed on adventure map
This commit is contained in:
@ -770,7 +770,15 @@ void CMapHandler::CMapBlitter::drawObjects(SDL_Surface * targetSurf, const Terra
|
|||||||
if (!canDrawObject(obj))
|
if (!canDrawObject(obj))
|
||||||
continue;
|
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)
|
if (objData.objBitmap)
|
||||||
{
|
{
|
||||||
Rect srcRect(object.rect.x, object.rect.y, tileSize, tileSize);
|
Rect srcRect(object.rect.x, object.rect.y, tileSize, tileSize);
|
||||||
|
Reference in New Issue
Block a user