1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-02 09:02:03 +02:00
This commit is contained in:
Ivan Savenko 2013-03-29 19:15:52 +00:00
parent 8f998b009b
commit a9fe9e9e8b
2 changed files with 25 additions and 14 deletions

View File

@ -560,6 +560,11 @@ bool CArtHandler::legalArtifact(ArtifactID id)
void CArtHandler::initAllowedArtifactsList(const std::vector<bool> &allowed) void CArtHandler::initAllowedArtifactsList(const std::vector<bool> &allowed)
{ {
allowedArtifacts.clear(); allowedArtifacts.clear();
treasures.clear();
minors.clear();
majors.clear();
relics.clear();
for (ArtifactID i=ArtifactID::SPELLBOOK; i<ArtifactID::ART_SELECTION; i.advance(1)) for (ArtifactID i=ArtifactID::SPELLBOOK; i<ArtifactID::ART_SELECTION; i.advance(1))
{ {
if (allowed[i] && legalArtifact(i)) if (allowed[i] && legalArtifact(i))

View File

@ -6426,13 +6426,18 @@ void CGMagi::onHeroVisit(const CGHeroInstance * h) const
{ {
if (ID == Obj::HUT_OF_MAGI) if (ID == Obj::HUT_OF_MAGI)
{ {
CenterView cv;
FoWChange fw;
cv.player = fw.player = h->tempOwner;
showInfoDialog(h, 61, soundBase::LIGHTHOUSE); showInfoDialog(h, 61, soundBase::LIGHTHOUSE);
if (!eyelist[subID].empty())
{
CenterView cv;
cv.player = h->tempOwner;
cv.focusTime = 2000;
FoWChange fw;
fw.player = h->tempOwner;
fw.mode = 1; fw.mode = 1;
BOOST_FOREACH(auto it, eyelist[subID]) BOOST_FOREACH(auto it, eyelist[subID])
{ {
const CGObjectInstance *eye = cb->getObj(it); const CGObjectInstance *eye = cb->getObj(it);
@ -6440,12 +6445,13 @@ void CGMagi::onHeroVisit(const CGHeroInstance * h) const
cb->getTilesInRange (fw.tiles, eye->pos, 10, h->tempOwner, 1); cb->getTilesInRange (fw.tiles, eye->pos, 10, h->tempOwner, 1);
cb->sendAndApply(&fw); cb->sendAndApply(&fw);
cv.pos = eye->pos; cv.pos = eye->pos;
cv.focusTime = 2000;
cb->sendAndApply(&cv); cb->sendAndApply(&cv);
} }
cv.pos = h->getPosition(false); cv.pos = h->getPosition(false);
cb->sendAndApply(&cv); cb->sendAndApply(&cv);
} }
}
else if (ID == Obj::EYE_OF_MAGI) else if (ID == Obj::EYE_OF_MAGI)
{ {
showInfoDialog(h,48,soundBase::invalid); showInfoDialog(h,48,soundBase::invalid);