Browse Source

Better name for map

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

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

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

Loading…
Cancel
Save