Prechádzať zdrojové kódy

Fix for quest artifacts

DjWarmonger 15 rokov pred
rodič
commit
b189356a63
2 zmenil súbory, kde vykonal 4 pridanie a 3 odobranie
  1. 1 1
      lib/CGameState.cpp
  2. 3 2
      lib/map.cpp

+ 1 - 1
lib/CGameState.cpp

@@ -910,7 +910,7 @@ std::pair<int,int> CGameState::pickObject (CGObjectInstance *obj)
 {
 	switch(obj->ID)
 	{
-	case 65: //random artifact //how the hell use IGameCallback for this?
+	case 65:
 		return std::pair<int,int>(5, VLC->arth->getRandomArt (CArtifact::ART_TREASURE | CArtifact::ART_MINOR | CArtifact::ART_MAJOR | CArtifact::ART_RELIC));
 	case 66: //random treasure artifact
 		return std::pair<int,int>(5, VLC->arth->getRandomArt (CArtifact::ART_TREASURE));

+ 3 - 2
lib/map.cpp

@@ -2072,8 +2072,9 @@ void Mapa::loadQuest(CQuest * guard, const unsigned char * bufor, int & i)
 			int artNumber = bufor[i]; ++i;
 			for(int yy=0; yy<artNumber; ++yy)
 			{
-				guard->m5arts.push_back(readNormalNr(bufor,i, 2)); i+=2;
-				allowedArtifact[artNumber] = false; //these are unavaliable for random generation
+				int artid = readNormalNr(bufor,i, 2); i+=2;
+				guard->m5arts.push_back(artid); 
+				allowedArtifact[artid] = false; //these are unavaliable for random generation
 			}
 			break;
 		}