Skip to content

Commit

Permalink
Fix moving AI hero rendering (ihhub#5787)
Browse files Browse the repository at this point in the history
  • Loading branch information
ihhub authored Aug 27, 2022
1 parent edab006 commit f00a04d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/fheroes2/gui/interface_gamearea.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,16 +132,16 @@ namespace
}
}

void populateHeroObjectInfo( TileUnfitRenderObjectInfo & tileUnfit, const Heroes * hero, const Heroes * currentHero )
void populateHeroObjectInfo( TileUnfitRenderObjectInfo & tileUnfit, const Heroes * hero )
{
assert( hero != nullptr );

const fheroes2::Point & heroPos = hero->GetCenter();
fheroes2::Point nextHeroPos = heroPos;

const bool movingHero = ( currentHero == hero ) && ( hero->isMoveEnabled() );
const bool movingHero = hero->isMoveEnabled();
if ( movingHero ) {
const Route::Path & path = currentHero->GetPath();
const Route::Path & path = hero->GetPath();
assert( !path.empty() );

nextHeroPos = Maps::GetPoint( Maps::GetDirectionIndex( hero->GetIndex(), path.GetFrontDirection() ) );
Expand Down Expand Up @@ -458,7 +458,7 @@ void Interface::GameArea::Redraw( fheroes2::Image & dst, int flag, bool isPuzzle
continue;
}

populateHeroObjectInfo( tileUnfit, tile.GetHeroes(), currentHero );
populateHeroObjectInfo( tileUnfit, tile.GetHeroes() );

break;
}
Expand Down

0 comments on commit f00a04d

Please sign in to comment.