1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-15 00:05:02 +02:00

ArtifactUtils::isSlotBackpack() func + refactoring

This commit is contained in:
SoundSSGood
2022-11-18 22:49:57 +02:00
parent 30bbb57619
commit e6e669d024
5 changed files with 15 additions and 17 deletions

View File

@ -4036,9 +4036,7 @@ bool CGameHandler::assembleArtifacts (ObjectInstanceID heroID, ArtifactPosition
CArtifact *combinedArt = VLC->arth->objects[assembleTo];
if(!combinedArt->constituents)
COMPLAIN_RET("assembleArtifacts: Artifact being attempted to assemble is not a combined artifacts!");
bool combineEquipped = true;
if(artifactSlot >= GameConstants::BACKPACK_START)
combineEquipped = false;
bool combineEquipped = !ArtifactUtils::isSlotBackpack(artifactSlot);
if(!vstd::contains(destArtifact->assemblyPossibilities(hero, combineEquipped), combinedArt))
COMPLAIN_RET("assembleArtifacts: It's impossible to assemble requested artifact!");