1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-23 00:28:08 +02:00

Place quest artifacts after all the treasures are already created.

This commit is contained in:
Tomasz Zieliński
2023-04-23 10:08:16 +02:00
parent 1fde8b588b
commit 80b5c53815
11 changed files with 64 additions and 54 deletions

View File

@ -16,6 +16,8 @@
#include "RoadPlacer.h"
#include "RiverPlacer.h"
#include "WaterAdopter.h"
#include "TreasurePlacer.h"
#include "QuestArtifactPlacer.h"
#include "../CCreatureHandler.h"
#include "../mapObjects/CommonConstructors.h"
#include "../mapObjects/MapObjects.h" //needed to resolve templates for CommonConstructors.h
@ -379,6 +381,21 @@ void ObjectManager::placeObject(rmg::Object & object, bool guarded, bool updateD
m->areaIsolated().add(instance->getVisitablePosition() + int3(0, -1, 0));
}
}
switch (instance->object().ID)
{
case Obj::RANDOM_TREASURE_ART:
case Obj::RANDOM_MINOR_ART: //In OH3 quest artifacts have higher value than normal arts
{
if (auto * qap = zone.getModificator<QuestArtifactPlacer>())
{
qap->rememberPotentialArtifactToReplace(&instance->object());
}
break;
}
default:
break;
}
}
switch(object.instances().front()->object().ID)