Fixed an NPE with iConomy handling
This commit is contained in:
parent
9a296c282e
commit
4c6c829348
2
README
2
README
@ -126,6 +126,8 @@ toowner - Whether the money from gate-use goes to the owner or nobody
|
||||
=============
|
||||
Changes
|
||||
=============
|
||||
[Version 0.4.6]
|
||||
- Fixed a bug in iConomy handling.
|
||||
[Version 0.4.5]
|
||||
- Owner of gate now isn't charged for use if target is owner
|
||||
- Updated for iConomy 5.x
|
||||
|
@ -313,7 +313,9 @@ public class Stargate extends JavaPlugin {
|
||||
|
||||
boolean iConCharge = (iConomyHandler.useiConomy() && !portal.isFree() && !hasPerm(player, "stargate.free.use", player.isOp()));
|
||||
String target = (portal.getGate().getToOwner() ? portal.getOwner() : null);
|
||||
iConCharge = iConCharge && !target.equals(player.getName());
|
||||
if (target != null)
|
||||
iConCharge = iConCharge && !target.equals(player.getName());
|
||||
|
||||
if (!iConCharge || iConomyHandler.chargePlayer(player.getName(), target, portal.getGate().getUseCost())) {
|
||||
if (iConCharge && portal.getGate().getUseCost() > 0) {
|
||||
player.sendMessage(ChatColor.GREEN + "Deducted " + iConomyHandler.format(portal.getGate().getUseCost()));
|
||||
@ -372,7 +374,8 @@ public class Stargate extends JavaPlugin {
|
||||
|
||||
boolean iConCharge = (iConomyHandler.useiConomy() && !portal.isFree() && !hasPerm(player, "stargate.free.use", player.isOp()));
|
||||
String target = (portal.getGate().getToOwner() ? portal.getOwner() : null);
|
||||
iConCharge = iConCharge && !target.equals(player.getName());
|
||||
if (target != null)
|
||||
iConCharge = iConCharge && !target.equals(player.getName());
|
||||
|
||||
if (!iConCharge || iConomyHandler.chargePlayer(player.getName(), target, portal.getGate().getUseCost())) {
|
||||
if (iConCharge && portal.getGate().getUseCost() > 0) {
|
||||
|
@ -1,6 +1,6 @@
|
||||
name: Stargate
|
||||
main: net.TheDgtl.Stargate.Stargate
|
||||
version: 0.4.5
|
||||
version: 0.4.6
|
||||
description: Stargate mod for Bukkit
|
||||
author: Drakia
|
||||
website: http://www.thedgtl.net
|
||||
|
Loading…
Reference in New Issue
Block a user