mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-15 00:05:02 +02:00
Access to heroes storage in CMap is now done via public methods
This commit is contained in:
@ -987,7 +987,6 @@ void CGMagi::onHeroVisit(const CGHeroInstance * h) const
|
||||
CGBoat::CGBoat(IGameCallback * cb)
|
||||
: CGObjectInstance(cb)
|
||||
{
|
||||
hero = nullptr;
|
||||
direction = 4;
|
||||
layer = EPathfindingLayer::SAIL;
|
||||
}
|
||||
@ -997,6 +996,22 @@ bool CGBoat::isCoastVisitable() const
|
||||
return true;
|
||||
}
|
||||
|
||||
void CGBoat::setBoardedHero(const CGHeroInstance * hero)
|
||||
{
|
||||
if (hero)
|
||||
boardedHeroID = hero->id;
|
||||
else
|
||||
boardedHeroID = ObjectInstanceID();
|
||||
}
|
||||
|
||||
const CGHeroInstance * CGBoat::getBoardedHero() const
|
||||
{
|
||||
if (boardedHeroID.hasValue())
|
||||
return cb->getHero(boardedHeroID);
|
||||
else
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void CGSirens::initObj(vstd::RNG & rand)
|
||||
{
|
||||
blockVisit = true;
|
||||
|
Reference in New Issue
Block a user