mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-15 00:05:02 +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:
@ -625,7 +625,7 @@ void CArtHandler::makeItCommanderArt(CArtifact * a, bool onlyCommander)
|
||||
a->possibleSlots[ArtBearer::COMMANDER].push_back(ArtifactPosition(slot));
|
||||
}
|
||||
|
||||
bool CArtHandler::legalArtifact(const ArtifactID & id)
|
||||
bool CArtHandler::legalArtifact(const ArtifactID & id) const
|
||||
{
|
||||
auto art = id.toArtifact();
|
||||
//assert ( (!art->constituents) || art->constituents->size() ); //artifacts is not combined or has some components
|
||||
@ -648,18 +648,6 @@ bool CArtHandler::legalArtifact(const ArtifactID & id)
|
||||
return false;
|
||||
}
|
||||
|
||||
void CArtHandler::initAllowedArtifactsList(const std::set<ArtifactID> & allowed)
|
||||
{
|
||||
allowedArtifacts.clear();
|
||||
|
||||
for (ArtifactID i : allowed)
|
||||
{
|
||||
if (legalArtifact(ArtifactID(i)))
|
||||
allowedArtifacts.push_back(i.toArtifact());
|
||||
//keep im mind that artifact can be worn by more than one type of bearer
|
||||
}
|
||||
}
|
||||
|
||||
std::set<ArtifactID> CArtHandler::getDefaultAllowed() const
|
||||
{
|
||||
std::set<ArtifactID> allowedArtifacts;
|
||||
|
Reference in New Issue
Block a user