mirror of
https://github.com/vcmi/vcmi.git
synced 2025-12-01 23:12:49 +02:00
Merge pull request #3069 from SoundSSGood/artifact-location-id
ArtifactLocation now use ID for artHolder identification
This commit is contained in:
@@ -1092,7 +1092,7 @@ std::string CGHeroInstance::getBiographyTextID() const
|
||||
|
||||
CGHeroInstance::ArtPlacementMap CGHeroInstance::putArtifact(ArtifactPosition pos, CArtifactInstance * art)
|
||||
{
|
||||
assert(art->artType->canBePutAt(this, pos));
|
||||
assert(art->canBePutAt(this, pos));
|
||||
|
||||
if(ArtifactUtils::isSlotEquipment(pos))
|
||||
attachTo(*art);
|
||||
@@ -1135,7 +1135,7 @@ void CGHeroInstance::removeSpellbook()
|
||||
|
||||
if(hasSpellbook())
|
||||
{
|
||||
ArtifactLocation(this, ArtifactPosition(ArtifactPosition::SPELLBOOK)).removeArtifact();
|
||||
getArt(ArtifactPosition::SPELLBOOK)->removeFrom(*this, ArtifactPosition::SPELLBOOK);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -144,7 +144,7 @@ void CQuest::completeQuest(IGameCallback * cb, const CGHeroInstance *h) const
|
||||
{
|
||||
if(h->hasArt(elem))
|
||||
{
|
||||
cb->removeArtifact(ArtifactLocation(h, h->getArtPos(elem, false)));
|
||||
cb->removeArtifact(ArtifactLocation(h->id, h->getArtPos(elem, false)));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -153,7 +153,7 @@ void CQuest::completeQuest(IGameCallback * cb, const CGHeroInstance *h) const
|
||||
auto parts = assembly->getPartsInfo();
|
||||
|
||||
// Remove the assembly
|
||||
cb->removeArtifact(ArtifactLocation(h, h->getArtPos(assembly)));
|
||||
cb->removeArtifact(ArtifactLocation(h->id, h->getArtPos(assembly)));
|
||||
|
||||
// Disassemble this backpack artifact
|
||||
for(const auto & ci : parts)
|
||||
|
||||
Reference in New Issue
Block a user