v2.5.0: fixed exotic crystal rarely affecting crystal path room item gen

This commit is contained in:
Evan Debenham
2024-07-07 15:52:04 -04:00
parent a6fe68317d
commit f64f84fac4

View File

@@ -256,9 +256,23 @@ public class CrystalPathRoom extends SpecialRoom {
while (true) {
Item reward = Generator.random(cat);
//we have to de-exotify for comparison here to weed out duplicates
Class rewardClass = reward.getClass();
if (reward instanceof ExoticPotion){
rewardClass = ExoticPotion.exoToReg.get(rewardClass);
} else if (reward instanceof ExoticScroll){
rewardClass = ExoticScroll.exoToReg.get(rewardClass);
}
boolean dupe = false;
for (Item i : items){
if (i.isSimilar(reward)){
Class iClass = i.getClass();
if (i instanceof ExoticPotion){
iClass = ExoticPotion.exoToReg.get(iClass);
} else if (i instanceof ExoticScroll){
iClass = ExoticScroll.exoToReg.get(iClass);
}
if (iClass == rewardClass){
dupes.add(reward);
dupe = true;
break;