1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

Implement CArtHandler::isBigArtifact and CArtifact::isTradable

This commit is contained in:
ArseniyShestakov
2014-12-24 20:43:35 +03:00
parent 937ef0227b
commit de6752c048
2 changed files with 15 additions and 0 deletions

View File

@@ -64,6 +64,11 @@ bool CArtifact::isBig () const
return VLC->arth->isBigArtifact(id);
}
bool CArtifact::isTradable () const
{
return VLC->arth->isTradableArtifact(id);
}
CArtifact::CArtifact()
{
setNodeType(ARTIFACT);
@@ -578,6 +583,14 @@ bool CArtHandler::legalArtifact(ArtifactID id)
!(art->constituents); //no combo artifacts spawning
}
bool CArtHandler::isTradableArtifact(ArtifactID id) const
{
if (id < 7 && id != ArtifactID::SPELL_SCROLL)
return false;
return true;
}
void CArtHandler::initAllowedArtifactsList(const std::vector<bool> &allowed)
{
allowedArtifacts.clear();