Skip to content

Commit

Permalink
Fixes a bug with 0 priced generators not being able to purchase.
Browse files Browse the repository at this point in the history
Reported in discord.
  • Loading branch information
BONNe committed Dec 26, 2021
1 parent d3f0cbe commit 34caf93
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1384,8 +1384,10 @@ public void purchaseGenerator(@NotNull User user,
@NotNull GeneratorDataObject generatorData,
@NotNull GeneratorTierObject generatorTier)
{
if (this.addon.isVaultProvided() && generatorTier.getGeneratorTierCost() > 0 &&
this.addon.getVaultHook().withdraw(user, generatorTier.getGeneratorTierCost()).transactionSuccess())
if (!this.addon.isVaultProvided() ||
generatorTier.getGeneratorTierCost() == 0 ||
(generatorTier.getGeneratorTierCost() > 0 &&
this.addon.getVaultHook().withdraw(user, generatorTier.getGeneratorTierCost()).transactionSuccess()))
{
// TODO: Deprecated code. Use "GeneratorBuyEvent" class.
Map<String, Object> keyValues = new HashMap<>();
Expand Down

0 comments on commit 34caf93

Please sign in to comment.