Merge branch 'fixTypeCount' into 'master'

Fix MostProminentCreatureType Count

See merge request core-developers/forge!3921
This commit is contained in:
Hans Mackowiak
2021-02-19 17:46:01 +00:00

View File

@@ -1980,14 +1980,13 @@ public class CardFactoryUtil {
for (final Card c : list) { for (final Card c : list) {
// Remove Duplicated types // Remove Duplicated types
final Set<String> creatureTypes = c.getType().getCreatureTypes(); final Set<String> creatureTypes = c.getType().getCreatureTypes();
if (creatureTypes.contains(CardType.AllCreatureTypes)) {
allCreatureType++;
continue;
}
for (String creatureType : creatureTypes) { for (String creatureType : creatureTypes) {
if (creatureType.equals(CardType.AllCreatureTypes)) { Integer count = map.get(creatureType);
allCreatureType++; map.put(creatureType, count == null ? 1 : count + 1);
}
else {
Integer count = map.get(creatureType);
map.put(creatureType, count == null ? 1 : count + 1);
}
} }
} }