v0.9.1: fixed various minor errors relating to time freeze interactions

This commit is contained in:
Evan Debenham 2020-10-21 13:55:39 -04:00
parent 989c524e33
commit dd9e25308b
3 changed files with 11 additions and 9 deletions

View File

@ -309,7 +309,8 @@ public class TimekeepersHourglass extends Artifact {
public void processTime(float time){ public void processTime(float time){
turnsToCost -= time; turnsToCost -= time;
while (turnsToCost < 0f){ //use 1/1,000 to account for rounding errors
while (turnsToCost < -0.001f){
turnsToCost += 2f; turnsToCost += 2f;
charge --; charge --;
} }

View File

@ -100,7 +100,8 @@ public class Swiftthistle extends Plant {
public void processTime(float time){ public void processTime(float time){
left -= time; left -= time;
if (left <= 0){ //use 1/1,000 to account for rounding errors
while (left < -0.001f){
detach(); detach();
} }

View File

@ -172,10 +172,10 @@ public class WndTradeItem extends WndInfoItem {
} }
item.detachAll( hero.belongings.backpack ); item.detachAll( hero.belongings.backpack );
new Gold( item.value() ).doPickUp( hero );
//selling items in the sell interface doesn't spend time //selling items in the sell interface doesn't spend time
hero.spend(-hero.cooldown()); hero.spend(-hero.cooldown());
new Gold( item.value() ).doPickUp( hero );
} }
private void sellOne( Item item ) { private void sellOne( Item item ) {
@ -188,10 +188,10 @@ public class WndTradeItem extends WndInfoItem {
item = item.detach( hero.belongings.backpack ); item = item.detach( hero.belongings.backpack );
new Gold( item.value() ).doPickUp( hero );
//selling items in the sell interface doesn't spend time //selling items in the sell interface doesn't spend time
hero.spend(-hero.cooldown()); hero.spend(-hero.cooldown());
new Gold( item.value() ).doPickUp( hero );
} }
} }