Fix logic issue in Other challenges.

This will fix issue when users could not complete other type challenges. There was logic error, that disallows negative number in required money and experience variables.
This commit is contained in:
BONNe 2019-01-30 18:47:23 +02:00 committed by GitHub
parent 8becd9c08b
commit 12fa0e2c86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -765,14 +765,14 @@ public class TryToComplete
private ChallengeResult checkOthers()
{
if (!this.addon.isEconomyProvided() ||
this.challenge.getRequiredMoney() <= 0 ||
this.challenge.getRequiredMoney() < 0 ||
!this.addon.getEconomyProvider().has(this.user, this.challenge.getRequiredMoney()))
{
this.user.sendMessage("challenges.not-enough-money",
"[money]",
Integer.toString(this.challenge.getRequiredMoney()));
}
else if (this.challenge.getRequiredExperience() <= 0 ||
else if (this.challenge.getRequiredExperience() < 0 ||
this.user.getPlayer().getTotalExperience() < this.challenge.getRequiredExperience())
{
this.user.sendMessage("challenges.not-enough-exp",