mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-25 22:42:04 +02:00
backpack assemble
This commit is contained in:
@@ -4031,13 +4031,17 @@ bool CGameHandler::assembleArtifacts (ObjectInstanceID heroID, ArtifactPosition
|
||||
if (!destArtifact)
|
||||
COMPLAIN_RET("assembleArtifacts: there is no such artifact instance!");
|
||||
|
||||
if (assemble)
|
||||
if(assemble)
|
||||
{
|
||||
CArtifact *combinedArt = VLC->arth->objects[assembleTo];
|
||||
if (!combinedArt->constituents)
|
||||
if(!combinedArt->constituents)
|
||||
COMPLAIN_RET("assembleArtifacts: Artifact being attempted to assemble is not a combined artifacts!");
|
||||
if (!vstd::contains(destArtifact->assemblyPossibilities(hero, true), combinedArt))
|
||||
bool combineEquipped = true;
|
||||
if(artifactSlot >= GameConstants::BACKPACK_START)
|
||||
combineEquipped = false;
|
||||
if(!vstd::contains(destArtifact->assemblyPossibilities(hero, combineEquipped), combinedArt))
|
||||
COMPLAIN_RET("assembleArtifacts: It's impossible to assemble requested artifact!");
|
||||
|
||||
|
||||
if(ArtifactUtils::checkSpellbookIsNeeded(hero, assembleTo, artifactSlot))
|
||||
giveHeroNewArtifact(hero, VLC->arth->objects[ArtifactID::SPELLBOOK], ArtifactPosition::SPELLBOOK);
|
||||
|
||||
Reference in New Issue
Block a user