Adds a missing insufficient funds message when checking if vehicle passengers can pay for the teleportation

This commit is contained in:
Kristian Knarvik 2021-11-01 13:54:31 +01:00
parent b98aec4a20
commit 91a0316e6e

View File

@ -154,9 +154,13 @@ public class VehicleEventListener implements Listener {
return false;
}
//Transfer payment if necessary
//Check if the player is able to afford the teleport fee
int cost = Stargate.getEconomyConfig().getUseCost(player, entrancePortal, destinationPortal);
return cost <= 0 || Stargate.getEconomyConfig().canAffordFee(player, cost);
boolean canAffordFee = cost <= 0 || Stargate.getEconomyConfig().canAffordFee(player, cost);
if (!canAffordFee) {
Stargate.getMessageSender().sendErrorMessage(player, Stargate.getString("ecoInFunds"));
}
return canAffordFee;
}
}