diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/TimekeepersHourglass.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/TimekeepersHourglass.java index 8af843ccf..3944fa509 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/TimekeepersHourglass.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/TimekeepersHourglass.java @@ -309,7 +309,8 @@ public class TimekeepersHourglass extends Artifact { public void processTime(float time){ turnsToCost -= time; - while (turnsToCost < 0f){ + //use 1/1,000 to account for rounding errors + while (turnsToCost < -0.001f){ turnsToCost += 2f; charge --; } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Swiftthistle.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Swiftthistle.java index 804dc21df..8c7f56265 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Swiftthistle.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Swiftthistle.java @@ -99,8 +99,9 @@ public class Swiftthistle extends Plant { public void processTime(float time){ left -= time; - - if (left <= 0){ + + //use 1/1,000 to account for rounding errors + while (left < -0.001f){ detach(); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndTradeItem.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndTradeItem.java index 0a54ebcb0..0cfea1c04 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndTradeItem.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndTradeItem.java @@ -171,11 +171,11 @@ public class WndTradeItem extends WndInfoItem { return; } item.detachAll( hero.belongings.backpack ); - - new Gold( item.value() ).doPickUp( hero ); - + //selling items in the sell interface doesn't spend time hero.spend(-hero.cooldown()); + + new Gold( item.value() ).doPickUp( hero ); } private void sellOne( Item item ) { @@ -187,11 +187,11 @@ public class WndTradeItem extends WndInfoItem { Hero hero = Dungeon.hero; item = item.detach( hero.belongings.backpack ); - - new Gold( item.value() ).doPickUp( hero ); - + //selling items in the sell interface doesn't spend time hero.spend(-hero.cooldown()); + + new Gold( item.value() ).doPickUp( hero ); } }