1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-17 00:07:41 +02:00

CArtifact refactoring

This commit is contained in:
SoundSSGood
2023-06-29 18:34:07 +03:00
parent d44821e733
commit 060aecc61c
11 changed files with 110 additions and 77 deletions

View File

@ -1528,7 +1528,7 @@ void NewArtifact::applyGs(CGameState *gs)
assert(art->artType);
art->setType(art->artType);
if(art->canBeDisassembled())
if(art->isCombined())
{
assert(art->artType->constituents);
for(const auto & part : *art->artType->constituents)
@ -1827,7 +1827,7 @@ void EraseArtifact::applyGs(CGameState *gs)
for(auto& p : aset->artifactsWorn)
{
auto art = p.second.artifact;
if(art->canBeDisassembled() && art->isPart(slot->artifact))
if(art->isCombined() && art->isPart(slot->artifact))
{
dis.al.slot = aset->getArtPos(art);
#ifndef NDEBUG
@ -2226,6 +2226,10 @@ void BattleResultAccepted::applyGs(CGameState * gs) const
art.second.artifact->growingUp();
}
}
for(auto & art : h->artifactsWorn)
{
art.second.artifact->growingUp();
}
}
}