Fixed an NPE with iConomy handling
This commit is contained in:
		
							
								
								
									
										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);
 | 
			
		||||
				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,6 +374,7 @@ 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);
 | 
			
		||||
				if (target != null)
 | 
			
		||||
					iConCharge = iConCharge && !target.equals(player.getName());
 | 
			
		||||
				
 | 
			
		||||
				if (!iConCharge || iConomyHandler.chargePlayer(player.getName(), target, portal.getGate().getUseCost())) {
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user