mirror of
https://github.com/vcmi/vcmi.git
synced 2025-08-13 19:54:17 +02:00
@@ -400,24 +400,24 @@ int CArtHandler::convertMachineID(int id, bool creToArt )
|
|||||||
|
|
||||||
void CArtHandler::sortArts()
|
void CArtHandler::sortArts()
|
||||||
{
|
{
|
||||||
// for (int i=0; i<allowedArtifacts.size(); ++i) //do 144, bo nie chcemy bzdurek
|
//for (int i=0; i<allowedArtifacts.size(); ++i) //do 144, bo nie chcemy bzdurek
|
||||||
// {
|
//{
|
||||||
// switch (allowedArtifacts[i]->aClass)
|
// switch (allowedArtifacts[i]->aClass)
|
||||||
// {
|
// {
|
||||||
// case CArtifact::ART_TREASURE:
|
// case CArtifact::ART_TREASURE:
|
||||||
// treasures.push_back(allowedArtifacts[i]);
|
// treasures.push_back(allowedArtifacts[i]);
|
||||||
// break;
|
// break;
|
||||||
// case CArtifact::ART_MINOR:
|
// case CArtifact::ART_MINOR:
|
||||||
// minors.push_back(allowedArtifacts[i]);
|
// minors.push_back(allowedArtifacts[i]);
|
||||||
// break;
|
// break;
|
||||||
// case CArtifact::ART_MAJOR:
|
// case CArtifact::ART_MAJOR:
|
||||||
// majors.push_back(allowedArtifacts[i]);
|
// majors.push_back(allowedArtifacts[i]);
|
||||||
// break;
|
// break;
|
||||||
// case CArtifact::ART_RELIC:
|
// case CArtifact::ART_RELIC:
|
||||||
// relics.push_back(allowedArtifacts[i]);
|
// relics.push_back(allowedArtifacts[i]);
|
||||||
// break;
|
// break;
|
||||||
// }
|
// }
|
||||||
// }
|
//}
|
||||||
}
|
}
|
||||||
void CArtHandler::erasePickedArt (si32 id)
|
void CArtHandler::erasePickedArt (si32 id)
|
||||||
{
|
{
|
||||||
@@ -467,10 +467,17 @@ void CArtHandler::getAllowed(std::vector<ConstTransitivePtr<CArtifact> > &out, i
|
|||||||
getAllowedArts (out, &majors, CArtifact::ART_MAJOR);
|
getAllowedArts (out, &majors, CArtifact::ART_MAJOR);
|
||||||
if (flags & CArtifact::ART_RELIC)
|
if (flags & CArtifact::ART_RELIC)
|
||||||
getAllowedArts (out, &relics, CArtifact::ART_RELIC);
|
getAllowedArts (out, &relics, CArtifact::ART_RELIC);
|
||||||
if (!out.size()) //no arts are avaliable
|
if (!out.size()) //no artifact of specified rarity, we need to take another one
|
||||||
|
{
|
||||||
|
getAllowedArts (out, &treasures, CArtifact::ART_TREASURE);
|
||||||
|
getAllowedArts (out, &minors, CArtifact::ART_MINOR);
|
||||||
|
getAllowedArts (out, &majors, CArtifact::ART_MAJOR);
|
||||||
|
getAllowedArts (out, &relics, CArtifact::ART_RELIC);
|
||||||
|
}
|
||||||
|
if (!out.size()) //no arts are avaliable at all
|
||||||
{
|
{
|
||||||
out.resize (64);
|
out.resize (64);
|
||||||
std::fill_n (out.begin(), 64, artifacts[2]); //magic
|
std::fill_n (out.begin(), 64, artifacts[2]); //Give Grail - this can't be banned (hopefully)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void CArtHandler::getAllowedArts(std::vector<ConstTransitivePtr<CArtifact> > &out, std::vector<CArtifact*> *arts, int flag)
|
void CArtHandler::getAllowedArts(std::vector<ConstTransitivePtr<CArtifact> > &out, std::vector<CArtifact*> *arts, int flag)
|
||||||
|
11
lib/map.cpp
11
lib/map.cpp
@@ -972,7 +972,16 @@ void Mapa::readHeader( const unsigned char * bufor, int &i)
|
|||||||
}
|
}
|
||||||
}//allowed artifacts have been read
|
}//allowed artifacts have been read
|
||||||
}
|
}
|
||||||
|
else //ban combo artifacts
|
||||||
|
{
|
||||||
|
BOOST_FOREACH(CArtifact *artifact, VLC->arth->artifacts)
|
||||||
|
{
|
||||||
|
if (artifact->constituents != NULL) //combo
|
||||||
|
{
|
||||||
|
allowedArtifact[artifact->id] = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
allowedSpell.resize(SPELLS_QUANTITY);
|
allowedSpell.resize(SPELLS_QUANTITY);
|
||||||
for(unsigned int x=0;x<allowedSpell.size();x++)
|
for(unsigned int x=0;x<allowedSpell.size();x++)
|
||||||
|
Reference in New Issue
Block a user