mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 18:58:00 +00:00
Avoid introducing an invalid creature type
This commit is contained in:
@@ -109,8 +109,9 @@ public class ChooseTypeEffect extends SpellAbilityEffect {
|
|||||||
//loop through sorted list and move each type to the front of the validTypes collection
|
//loop through sorted list and move each type to the front of the validTypes collection
|
||||||
for (Entry<String, Integer> entry : sortedList) {
|
for (Entry<String, Integer> entry : sortedList) {
|
||||||
String type = entry.getKey();
|
String type = entry.getKey();
|
||||||
validTypes.remove(type);
|
if (validTypes.remove(type)) { //ensure an invalid type isn't introduced
|
||||||
validTypes.add(0, type);
|
validTypes.add(0, type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user