1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-17 01:32:21 +02:00

Access to heroes storage in CMap is now done via public methods

This commit is contained in:
Ivan Savenko
2025-03-14 17:07:30 +00:00
parent 1f502c0548
commit 745040def3
26 changed files with 189 additions and 152 deletions

View File

@ -439,8 +439,8 @@ std::shared_ptr<CAnimation> MapRendererObjects::getFlagAnimation(const CGObjectI
if(obj->ID == Obj::BOAT)
{
const auto * boat = dynamic_cast<const CGBoat *>(obj);
if(boat && boat->hero && !boat->flagAnimations[boat->hero->tempOwner.getNum()].empty())
return getAnimation(boat->flagAnimations[boat->hero->tempOwner.getNum()], true, false);
if(boat && boat->getBoardedHero() && !boat->flagAnimations[boat->getBoardedHero()->tempOwner.getNum()].empty())
return getAnimation(boat->flagAnimations[boat->getBoardedHero()->tempOwner.getNum()], true, false);
}
return nullptr;
@ -452,7 +452,7 @@ std::shared_ptr<CAnimation> MapRendererObjects::getOverlayAnimation(const CGObje
{
// Boats have additional animation with waves around boat
const auto * boat = dynamic_cast<const CGBoat *>(obj);
if(boat && boat->hero && !boat->overlayAnimation.empty())
if(boat && boat->getBoardedHero() && !boat->overlayAnimation.empty())
return getAnimation(boat->overlayAnimation, true, false);
}
return nullptr;