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

function ArtifactUtils::checkSpellbookIsNeeded for the artifacts like a Titan's thunder

This commit is contained in:
SoundSSGood
2022-11-07 00:18:05 +02:00
parent 0f391e19d5
commit f72a3e3884
5 changed files with 33 additions and 22 deletions

View File

@@ -1093,18 +1093,6 @@ DLL_LINKAGE void MoveArtifact::applyGs(CGameState * gs)
assert(!dst.getArt());
art->move(src, dst);
//TODO what'll happen if Titan's thunder is equipped by pickin git up or the start of game?
if (a->artType->id == ArtifactID::TITANS_THUNDER && dst.slot == ArtifactPosition::RIGHT_HAND) //Titan's Thunder creates new spellbook on equip
{
auto hPtr = boost::get<ConstTransitivePtr<CGHeroInstance> >(&dst.artHolder);
if(hPtr)
{
CGHeroInstance *h = *hPtr;
if(h && !h->hasSpellbook())
gs->giveHeroArtifact(h, ArtifactID::SPELLBOOK);
}
}
}
DLL_LINKAGE void BulkMoveArtifacts::applyGs(CGameState * gs)