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

backpack assemble

This commit is contained in:
SoundSSGood
2022-11-18 01:32:25 +02:00
parent 16b650136a
commit e9ab894638
4 changed files with 30 additions and 21 deletions

View File

@@ -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);