Browse Source

Fix loading of allowed artifacts from hota h3m

Ivan Savenko 2 years ago
parent
commit
f86133705e
1 changed files with 2 additions and 9 deletions
  1. 2 9
      lib/CArtHandler.cpp

+ 2 - 9
lib/CArtHandler.cpp

@@ -709,16 +709,9 @@ void CArtHandler::initAllowedArtifactsList(const std::vector<bool> &allowed)
 	majors.clear();
 	relics.clear();
 
-	for (ArtifactID i=ArtifactID::SPELLBOOK; i<ArtifactID::ART_SELECTION; i.advance(1))
+	for (ArtifactID i=ArtifactID::SPELLBOOK; i < ArtifactID(static_cast<si32>(objects.size())); i.advance(1))
 	{
-		//check artifacts allowed on a map
-		//TODO: This line will be different when custom map format is implemented
-		if (allowed[i] && legalArtifact(i))
-			allowedArtifacts.push_back(objects[i]);
-	}
-	for(ArtifactID i = ArtifactID::ART_SELECTION; i < ArtifactID(static_cast<si32>(objects.size())); i.advance(1)) //try to allow all artifacts added by mods
-	{
-		if (legalArtifact(ArtifactID(i)))
+		if (allowed[i] && legalArtifact(ArtifactID(i)))
 			allowedArtifacts.push_back(objects[i]);
 			 //keep im mind that artifact can be worn by more than one type of bearer
 	}