mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-17 00:07:41 +02:00
Remove allowed artifacts list from arthandler
1. Handlers should not contain non-const game state data 2. This field was duplicating same field in CMap 3. Due to removal of VLC serialization, this field is not updated on map load leading to issues with artifact randomization
This commit is contained in:
@ -384,8 +384,9 @@ namespace JsonRandom
|
||||
ArtifactID loadArtifact(const JsonNode & value, CRandomGenerator & rng, const Variables & variables)
|
||||
{
|
||||
std::set<ArtifactID> allowedArts;
|
||||
for (auto const * artifact : VLC->arth->allowedArtifacts)
|
||||
allowedArts.insert(artifact->getId());
|
||||
for(const auto & artifact : VLC->arth->objects)
|
||||
if (IObjectInterface::cb->isAllowed(artifact->getId()) && VLC->arth->legalArtifact(artifact->getId()))
|
||||
allowedArts.insert(artifact->getId());
|
||||
|
||||
std::set<ArtifactID> potentialPicks = filterKeys(value, allowedArts, variables);
|
||||
|
||||
|
Reference in New Issue
Block a user