mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-17 00:07:41 +02:00
Artifact instances are now owned solely by CMap
This commit is contained in:
@ -663,10 +663,8 @@ void CGArtifact::initObj(vstd::RNG & rand)
|
||||
if(ID == Obj::ARTIFACT)
|
||||
{
|
||||
if (!storedArtifact)
|
||||
{
|
||||
storedArtifact = ArtifactUtils::createArtifact(ArtifactID());
|
||||
cb->gameState()->getMap().addNewArtifactInstance(storedArtifact);
|
||||
}
|
||||
storedArtifact = cb->gameState()->createArtifact(ArtifactID());
|
||||
|
||||
if(!storedArtifact->getType())
|
||||
storedArtifact->setType(getArtifact().toArtifact());
|
||||
}
|
||||
@ -813,15 +811,6 @@ void CGArtifact::blockingDialogAnswered(const CGHeroInstance *hero, int32_t answ
|
||||
cb->startBattle(hero, this);
|
||||
}
|
||||
|
||||
void CGArtifact::afterAddToMap(CMap * map)
|
||||
{
|
||||
//Artifacts from map objects are never removed
|
||||
//FIXME: This should be revertible in map editor
|
||||
|
||||
if(ID == Obj::SPELL_SCROLL && storedArtifact && storedArtifact->getId().getNum() < 0)
|
||||
map->addNewArtifactInstance(storedArtifact);
|
||||
}
|
||||
|
||||
void CGArtifact::serializeJsonOptions(JsonSerializeFormat& handler)
|
||||
{
|
||||
handler.serializeStruct("guardMessage", message);
|
||||
|
Reference in New Issue
Block a user