From e7f45d7c4068cf78f4d189260491acb6f9e5e752 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Tue, 19 Apr 2016 21:43:47 -0400 Subject: [PATCH] v0.3.5: fixed a bug with picking up the amulet for the first time --- .../shatteredpixeldungeon/items/Amulet.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/Amulet.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/Amulet.java index 7aba653b6..2796e13b3 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/Amulet.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/Amulet.java @@ -23,6 +23,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items; import com.shatteredpixel.shatteredpixeldungeon.Badges; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.Statistics; +import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.scenes.AmuletScene; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; @@ -66,7 +67,16 @@ public class Amulet extends Item { Statistics.amuletObtained = true; Badges.validateVictory(); hero.spend(-TIME_TO_PICK_UP); - showAmuletScene( true ); + + //add a delayed actor here so pickup behaviour can fully process. + Actor.addDelayed(new Actor(){ + @Override + protected boolean act() { + Actor.remove(this); + showAmuletScene( true ); + return false; + } + }, -5); } return true;