1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-28 08:48:48 +02:00

Fix loading of allowed artifacts from hota h3m

This commit is contained in:
Ivan Savenko 2023-06-16 19:10:48 +03:00
parent 02ea798c97
commit f86133705e

View File

@ -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
}