All pastes #46900 Raw Edit

Untitled

public text v1 · immutable
#46900 ·published 2006-03-25 02:22 UTC
rendered paste body
Index: C:/eclipse/workspace/C4_Gamserver/java/net/sf/l2j/gameserver/clientpackets/RequestBuyItem.java
===================================================================
--- C:/eclipse/workspace/C4_Gamserver/java/net/sf/l2j/gameserver/clientpackets/RequestBuyItem.java	(revision 1666)
+++ C:/eclipse/workspace/C4_Gamserver/java/net/sf/l2j/gameserver/clientpackets/RequestBuyItem.java	(working copy)
@@ -198,7 +198,7 @@
 		}
 
 		// Charge buyer and add tax to castle treasury if not owned by npc clan
-		if ((subTotal < 0) || !player.reduceAdena("Buy", (int)(subTotal + tax), player.getLastFolkNPC(), false))
+		if ((subTotal < 0) || player.getAdena() < 1 || !player.reduceAdena("Buy", (int)(subTotal + tax), player.getLastFolkNPC(), false))
 		{
 			sendPacket(new SystemMessage(SystemMessage.YOU_NOT_ENOUGH_ADENA));
 			return;