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

Added workaround for loading spellbook existance status

This commit is contained in:
Ivan Savenko
2023-06-27 13:58:45 +03:00
parent 88566cb1ef
commit cc91be3518
3 changed files with 14 additions and 3 deletions

View File

@@ -878,6 +878,9 @@ void CMapLoaderH3M::loadArtifactsOfHero(CGHeroInstance * hero)
if(!hasArtSet)
return;
// Workaround - if hero has customized artifacts game should not attempt to add spellbook based on hero type
hero->spells.insert(SpellID::SPELLBOOK_PRESET);
if(!hero->artifactsWorn.empty() || !hero->artifactsInBackpack.empty())
{
logGlobal->warn("Hero %s at %s has set artifacts twice (in map properties and on adventure map instance). Using the latter set...", hero->getNameTranslated(), hero->pos.toString());