mirror of
https://github.com/vcmi/vcmi.git
synced 2025-09-16 09:26:28 +02:00
Fixed bug 116 - constructing bonusing buildings will now affect town heroes.
This commit is contained in:
@@ -1560,11 +1560,12 @@ void CGTownInstance::onHeroVisit(const CGHeroInstance * h) const
|
||||
}
|
||||
else
|
||||
{
|
||||
removeCapitols (h->getOwner(), true);
|
||||
cb->setOwner(id, h->tempOwner);
|
||||
removeCapitols (h->getOwner(), true);
|
||||
cb->heroVisitCastle(id, h->id);
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
cb->heroVisitCastle(id, h->id);
|
||||
}
|
||||
|
||||
@@ -1626,7 +1627,7 @@ void CGTownInstance::removeCapitols (ui8 owner, bool me) const
|
||||
{
|
||||
if (hasCapitol()) // search for older capitol
|
||||
{
|
||||
PlayerState* state = cb->gameState()->getPlayer (owner);
|
||||
PlayerState* state = cb->gameState()->getPlayer (owner); //get all towns owned by player
|
||||
for (std::vector<CGTownInstance*>::const_iterator i = state->towns.begin(); i < state->towns.end(); ++i)
|
||||
{
|
||||
if (*i != this && (*i)->hasCapitol())
|
||||
|
@@ -2053,7 +2053,10 @@ bool CGameHandler::buildStructure( si32 tid, si32 bid )
|
||||
if(t->garrisonHero)
|
||||
giveSpells(t,t->garrisonHero);
|
||||
}
|
||||
|
||||
if(t->visitingHero)
|
||||
vistiCastleObjects (t, t->visitingHero);
|
||||
if(t->garrisonHero)
|
||||
vistiCastleObjects (t, t->garrisonHero);
|
||||
return true;
|
||||
}
|
||||
bool CGameHandler::razeStructure (si32 tid, si32 bid)
|
||||
|
Reference in New Issue
Block a user