Browse Source

templateHash used in this context.

postwipe-mines
MagicBot 7 months ago
parent
commit
31292785a5
  1. 4
      src/engine/mbEnums.java
  2. 2
      src/engine/net/client/handlers/ArcMineChangeProductionMsgHandler.java
  3. 2
      src/engine/objects/City.java
  4. 4
      src/engine/objects/Warehouse.java

4
src/engine/mbEnums.java

@ -2740,7 +2740,7 @@ public class mbEnums { @@ -2740,7 +2740,7 @@ public class mbEnums {
WORMWOOD(1580018, 1204785075, 1532478436, 500, 5);
public static HashMap<Integer, ResourceType> templateLookup = new HashMap<>();
public static HashMap<Integer, ResourceType> hashLookup = new HashMap<>();
public static HashMap<Integer, ResourceType> templateHashLookup = new HashMap<>();
public int templateID;
public ItemTemplate template;
public int resourceHash;
@ -2761,7 +2761,7 @@ public class mbEnums { @@ -2761,7 +2761,7 @@ public class mbEnums {
for (ResourceType resourceType : ResourceType.values()) {
templateLookup.put(resourceType.templateID, resourceType);
hashLookup.put(resourceType.resourceHash, resourceType);
templateHashLookup.put(resourceType.templateHash, resourceType);
}
}

2
src/engine/net/client/handlers/ArcMineChangeProductionMsgHandler.java

@ -50,7 +50,7 @@ public class ArcMineChangeProductionMsgHandler extends AbstractClientMsgHandler @@ -50,7 +50,7 @@ public class ArcMineChangeProductionMsgHandler extends AbstractClientMsgHandler
//make sure valid resource
mbEnums.ResourceType resource = mbEnums.ResourceType.hashLookup.get(changeProductionMsg.getResourceHash());
mbEnums.ResourceType resource = mbEnums.ResourceType.templateHashLookup.get(changeProductionMsg.getResourceHash());
if (resource == null)
return true;

2
src/engine/objects/City.java

@ -1399,7 +1399,7 @@ public class City extends AbstractWorldObject { @@ -1399,7 +1399,7 @@ public class City extends AbstractWorldObject {
taxPercent = .20f;
for (int resourceHash : msg.getResources().keySet())
resources.add(ResourceType.hashLookup.get(resourceHash));
resources.add(ResourceType.templateHashLookup.get(resourceHash));
for (ResourceType resourceType : resources) {
if (Warehouse.isAboveCap(ruledWarehouse, resourceType, (int) (city.warehouse.resources.get(resourceType) * taxPercent))) {

4
src/engine/objects/Warehouse.java

@ -140,7 +140,7 @@ public class Warehouse { @@ -140,7 +140,7 @@ public class Warehouse {
if (warehouse == null)
return;
mbEnums.ResourceType resourceType = mbEnums.ResourceType.hashLookup.get(msg.getHashID());
mbEnums.ResourceType resourceType = mbEnums.ResourceType.templateHashLookup.get(msg.getHashID());
if (isResourceLocked(warehouse, resourceType)) {
ChatManager.chatSystemInfo(playerCharacter, "You cannot withdrawl a locked resource.");
@ -182,7 +182,7 @@ public class Warehouse { @@ -182,7 +182,7 @@ public class Warehouse {
warehouse = city.warehouse;
mbEnums.ResourceType resourceType = mbEnums.ResourceType.hashLookup.get(hashID);
mbEnums.ResourceType resourceType = mbEnums.ResourceType.templateHashLookup.get(hashID);
// toggle lock

Loading…
Cancel
Save