v0.3.2: fixed a concurrent modification exception in distortion traps

This commit is contained in:
Evan Debenham 2015-10-10 04:38:37 -04:00
parent 5d24147312
commit 69667baafb

View File

@ -39,7 +39,7 @@ public class DistortionTrap extends Trap{
@Override
public void activate() {
InterlevelScene.returnDepth = Dungeon.depth;
for (Item item : Dungeon.hero.belongings.backpack.items){
for (Item item : Dungeon.hero.belongings.backpack.items.toArray( new Item[0])){
if (item instanceof Key && ((Key)item).depth == Dungeon.depth){
item.detachAll(Dungeon.hero.belongings.backpack);
}