Ivan Savenko 12 年之前
父節點
當前提交
a9fe9e9e8b
共有 2 個文件被更改,包括 25 次插入14 次删除
  1. 5 0
      lib/CArtHandler.cpp
  2. 20 14
      lib/CObjectHandler.cpp

+ 5 - 0
lib/CArtHandler.cpp

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

+ 20 - 14
lib/CObjectHandler.cpp

@@ -6426,25 +6426,31 @@ void CGMagi::onHeroVisit(const CGHeroInstance * h) const
 {
 	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);
 
-		fw.mode = 1;
-		BOOST_FOREACH(auto it, eyelist[subID])
+		if (!eyelist[subID].empty())
 		{
-			const CGObjectInstance *eye = cb->getObj(it);
-
-			cb->getTilesInRange (fw.tiles, eye->pos, 10, h->tempOwner, 1);
-			cb->sendAndApply(&fw);
-			cv.pos = eye->pos;
+			CenterView cv;
+			cv.player = h->tempOwner;
 			cv.focusTime = 2000;
+
+			FoWChange fw;
+			fw.player = h->tempOwner;
+			fw.mode = 1;
+
+			BOOST_FOREACH(auto it, eyelist[subID])
+			{
+				const CGObjectInstance *eye = cb->getObj(it);
+
+				cb->getTilesInRange (fw.tiles, eye->pos, 10, h->tempOwner, 1);
+				cb->sendAndApply(&fw);
+				cv.pos = eye->pos;
+
+				cb->sendAndApply(&cv);
+			}
+			cv.pos = h->getPosition(false);
 			cb->sendAndApply(&cv);
 		}
-		cv.pos = h->getPosition(false);
-		cb->sendAndApply(&cv);
 	}
 	else if (ID == Obj::EYE_OF_MAGI)
 	{