1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00

CMap removed from CArtifactSet level

This commit is contained in:
SoundSSGood
2024-09-04 14:32:47 +03:00
parent 1e0f131d7f
commit b06426ac43
10 changed files with 50 additions and 41 deletions

View File

@@ -14,7 +14,6 @@
#include "GameSettings.h"
#include "spells/CSpellHandler.h"
#include "mapping/CMap.h"
#include "mapObjects/CGHeroInstance.h"
VCMI_LIB_NAMESPACE_BEGIN
@@ -256,33 +255,23 @@ DLL_LINKAGE CArtifactInstance * ArtifactUtils::createNewArtifactInstance(const A
return ArtifactUtils::createNewArtifactInstance(aid.toArtifact());
}
DLL_LINKAGE CArtifactInstance * ArtifactUtils::createArtifact(CMap * map, const ArtifactID & aid, SpellID spellID)
DLL_LINKAGE CArtifactInstance * ArtifactUtils::createArtifact(const ArtifactID & aid, SpellID spellID)
{
CArtifactInstance * art = nullptr;
if(aid.getNum() >= 0)
{
if(spellID == SpellID::NONE)
{
art = ArtifactUtils::createNewArtifactInstance(aid);
return ArtifactUtils::createNewArtifactInstance(aid);
}
else
{
art = ArtifactUtils::createScroll(spellID);
return ArtifactUtils::createScroll(spellID);
}
}
else
{
art = new CArtifactInstance(); // random, empty
return new CArtifactInstance(); // random, empty
}
map->addNewArtifactInstance(art);
if(art->artType && art->isCombined())
{
for(auto & part : art->getPartsInfo())
{
map->addNewArtifactInstance(part.art);
}
}
return art;
}
DLL_LINKAGE void ArtifactUtils::insertScrrollSpellName(std::string & description, const SpellID & sid)