diff --git a/src/engine/gameManager/GroupManager.java b/src/engine/gameManager/GroupManager.java index 8c2565d1..ccc5fc7b 100644 --- a/src/engine/gameManager/GroupManager.java +++ b/src/engine/gameManager/GroupManager.java @@ -303,12 +303,13 @@ public enum GroupManager { } public static boolean goldSplit(PlayerCharacter pc, Item item, ClientConnection origin, AbstractWorldObject tar) { - if (item == null || pc == null || tar == null || item.getItemBase() == null) { + + if (item == null || pc == null || tar == null) { Logger.error("null something"); return false; } - if (item.getItemBase().getUUID() != 7) //only split goldItem + if (!item.template.item_type.equals(Enum.ItemType.GOLD)) //only split goldItem return false; Group group = getGroup(pc); @@ -316,7 +317,6 @@ public enum GroupManager { if (group == null || !group.getSplitGold()) //make sure player is grouped and split is on return false; - ArrayList playersSplit = new ArrayList<>(); //get group members @@ -331,8 +331,8 @@ public enum GroupManager { playersSplit.add(groupMember); } + //make sure more than one group member in loot range - //make sure more then one group member in loot range int size = playersSplit.size(); if (size < 2) @@ -358,8 +358,8 @@ public enum GroupManager { item.setNumOfItems(0); } else item.setNumOfItems(0); - for (PlayerCharacter splitPlayer : playersSplit) { + for (PlayerCharacter splitPlayer : playersSplit) { int amt = (group.isGroupLead(splitPlayer)) ? (amount + dif) : amount; if (amt > 0) @@ -368,7 +368,6 @@ public enum GroupManager { for (PlayerCharacter splitPlayer : playersSplit) { - UpdateGoldMsg ugm = new UpdateGoldMsg(splitPlayer); ugm.configure(); @@ -380,7 +379,6 @@ public enum GroupManager { updateTargetGold.configure(); DispatchMessage.dispatchMsgToInterestArea(tar, updateTargetGold, Enum.DispatchChannel.SECONDARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false); - // //TODO send group split message String text = "Group Split: " + amount; ChatManager.chatGroupInfo(pc, text);