Browse Source

Better name for map

combat-2
MagicBot 7 months ago
parent
commit
9bbe9b399e
  1. 4
      src/engine/net/client/handlers/ItemProductionMsgHandler.java
  2. 16
      src/engine/net/client/msg/ItemProductionMsg.java

4
src/engine/net/client/handlers/ItemProductionMsgHandler.java

@ -473,7 +473,7 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler {
junkItem(msg.getTemplateID(), vendorNPC, origin); junkItem(msg.getTemplateID(), vendorNPC, origin);
break; break;
case ACTION_RECYCLE: case ACTION_RECYCLE:
recycleItem(msg.getItemIDtoTypeMap(), vendorNPC, origin); recycleItem(msg.getItems(), vendorNPC, origin);
msg.setActionType(7); msg.setActionType(7);
dispatch = Dispatch.borrow(player, msg); dispatch = Dispatch.borrow(player, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
@ -497,7 +497,7 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler {
setItemPrice(msg.getItemType(), msg.getTemplateID(), msg.getItemPrice(), vendorNPC, origin); setItemPrice(msg.getItemType(), msg.getTemplateID(), msg.getItemPrice(), vendorNPC, origin);
break; break;
case ACTION_TAKE: case ACTION_TAKE:
takeItem(msg.getItemIDtoTypeMap(), vendorNPC, origin); takeItem(msg.getItems(), vendorNPC, origin);
dispatch = Dispatch.borrow(player, msg); dispatch = Dispatch.borrow(player, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
break; break;

16
src/engine/net/client/msg/ItemProductionMsg.java

@ -49,7 +49,7 @@ public class ItemProductionMsg extends ClientNetMsg {
private int npcUUID; private int npcUUID;
private boolean add; private boolean add;
private int itemPrice; private int itemPrice;
private HashMap<Integer, Integer> itemIDtoTypeMap; private HashMap<Integer, Integer> items;
/** /**
* This is the general purpose constructor. * This is the general purpose constructor.
@ -228,11 +228,11 @@ public class ItemProductionMsg extends ClientNetMsg {
writer.put((byte) 1); writer.put((byte) 1);
writer.putInt(building.getStrongboxValue()); writer.putInt(building.getStrongboxValue());
if (this.itemIDtoTypeMap != null) { if (this.items != null) {
writer.putInt(this.itemIDtoTypeMap.size()); writer.putInt(this.items.size());
for (int itemID : this.itemIDtoTypeMap.keySet()) { for (int itemID : this.items.keySet()) {
writer.putInt(this.itemIDtoTypeMap.get(itemID)); writer.putInt(this.items.get(itemID));
writer.putInt(itemID); writer.putInt(itemID);
} }
@ -401,7 +401,7 @@ public class ItemProductionMsg extends ClientNetMsg {
tempIDs.put(this.templateID, type); tempIDs.put(this.templateID, type);
} }
reader.getInt(); reader.getInt();
this.itemIDtoTypeMap = tempIDs; this.items = tempIDs;
break; break;
case ACTION_DEPOSIT: case ACTION_DEPOSIT:
this.itemType = reader.getInt(); this.itemType = reader.getInt();
@ -527,8 +527,8 @@ public class ItemProductionMsg extends ClientNetMsg {
return npcUUID; return npcUUID;
} }
public HashMap<Integer, Integer> getItemIDtoTypeMap() { public HashMap<Integer, Integer> getItems() {
return itemIDtoTypeMap; return items;
} }
/** /**

Loading…
Cancel
Save