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

bulk move artifacts only equipped, only backpack

This commit is contained in:
SoundSSGood
2023-07-24 19:09:17 +03:00
parent c6a86d9a5f
commit a83f290e13
16 changed files with 99 additions and 53 deletions

View File

@@ -55,6 +55,16 @@ const std::vector<CCombinedArtifactInstance::PartInfo> & CCombinedArtifactInstan
return partsInfo;
}
void CCombinedArtifactInstance::addPlacementMap(CArtifactSet::ArtPlacementMap & placementMap)
{
if(!placementMap.empty())
for(auto& part : partsInfo)
{
assert(placementMap.find(part.art) != placementMap.end());
part.slot = placementMap.at(part.art);
}
}
SpellID CScrollArtifactInstance::getScrollSpellID() const
{
auto artInst = static_cast<const CArtifactInstance*>(this);
@@ -163,7 +173,7 @@ bool CArtifactInstance::isCombined() const
void CArtifactInstance::putAt(const ArtifactLocation & al)
{
al.getHolderArtSet()->putArtifact(al.slot, this);
addPlacementMap(al.getHolderArtSet()->putArtifact(al.slot, this));
}
void CArtifactInstance::removeFrom(const ArtifactLocation & al)