fix buying gem quests

This commit is contained in:
Phillip Thelen 2016-08-04 12:14:50 +02:00
parent f2a716edc5
commit aad16502fd
3 changed files with 4 additions and 4 deletions

View file

@ -2,7 +2,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.habitrpg.android.habitica"
android:versionCode="109"
android:versionCode="110"
android:versionName="0.0.33.1"
android:screenOrientation="portrait"
android:installLocation="auto" >

View file

@ -877,7 +877,7 @@ public class MainActivity extends BaseActivity implements Action1<Throwable>, Ha
} else {
observable = apiHelper.apiService.purchaseHourglassItem(event.item.purchaseType, event.item.key);
}
} else if (event.item.purchaseType.equals("quests")) {
} else if (event.item.purchaseType.equals("quests") && event.item.getCurrency().equals("gold")) {
observable = apiHelper.apiService.purchaseQuest(event.item.key);
} else {
observable = apiHelper.apiService.purchaseItem(event.item.purchaseType, event.item.key);

View file

@ -96,9 +96,9 @@ public class ShopItem {
public boolean canBuy(HabitRPGUser user) {
if (getCurrency().equals("gold")) {
return getValue() < user.getStats().getGp();
return getValue() <= user.getStats().getGp();
} else if (getCurrency().equals("gems")) {
return getValue() < (user.getBalance()*4);
return getValue() <= (user.getBalance()*4);
} else {
return false;
}