Read item weight, value and base name through the bridge
Consumers of the legacy ItemTemplate item_wt, item_value and item_base_name now read getItemWt(), getItemValue() and getItemBaseName() on template.cacheTemplate. Parity (offline, scripts/p14.py, 7586 templates): 0 differences in item_wt, item_value and item_base_name. No value changes expected. JSON-Refactor-Plan Task 1.4. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
b8ac8cce3e
commit
dc4a9ee08a
29 files changed
+59
-59
No files matched your search
@@ -856,7 +856,7 @@ public class CharacterItemManager {
|
||||
this.itemIDtoType.put(i.getObjectUUID(), i.getObjectType().ordinal());
|
||||
|
||||
if (i.template != null)
|
||||
this.inventoryWeight += i.template.item_wt;
|
||||
this.inventoryWeight += i.template.cacheTemplate.getItemWt();
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -1092,7 +1092,7 @@ public class CharacterItemManager {
|
||||
|
||||
//test inventory is not full
|
||||
|
||||
if (!hasRoomInventory(template.item_wt))
|
||||
if (!hasRoomInventory(template.cacheTemplate.getItemWt()))
|
||||
return false;
|
||||
|
||||
if (!itemMan.inventory.contains(purchasedItem))
|
||||
@@ -1105,8 +1105,8 @@ public class CharacterItemManager {
|
||||
|
||||
// Reset value
|
||||
|
||||
purchasedItem.value = (int) (purchasedItem.template.item_value * (purchasedItem.combat_health_current / purchasedItem.template.combat_health_full));
|
||||
purchasedItem.magicValue = purchasedItem.template.item_value + purchasedItem.calcMagicValue();
|
||||
purchasedItem.value = (int) (purchasedItem.template.cacheTemplate.getItemValue() * (purchasedItem.combat_health_current / purchasedItem.template.combat_health_full));
|
||||
purchasedItem.magicValue = purchasedItem.template.cacheTemplate.getItemValue() + purchasedItem.calcMagicValue();
|
||||
|
||||
// db transfer successfully, remove from this character
|
||||
// skip this check if this is a mobLoot item (which is not in any inventory)
|
||||
@@ -1194,7 +1194,7 @@ public class CharacterItemManager {
|
||||
if (lootItem.template == null)
|
||||
return null;
|
||||
|
||||
int weight = lootItem.template.item_wt;
|
||||
int weight = lootItem.template.cacheTemplate.getItemWt();
|
||||
|
||||
// make sure lootingPlayer has room for item
|
||||
if (!lootItem.template.cacheTemplate.getItemType().equals(ItemType.GOLD) && !looterItems.hasRoomInventory(weight))
|
||||
@@ -1676,7 +1676,7 @@ public class CharacterItemManager {
|
||||
if (item == null)
|
||||
continue;
|
||||
|
||||
weight += item.template.item_wt;
|
||||
weight += item.template.cacheTemplate.getItemWt();
|
||||
}
|
||||
return weight;
|
||||
}
|
||||
@@ -1696,7 +1696,7 @@ public class CharacterItemManager {
|
||||
this.bankWeight = 0;
|
||||
for (Item item : this.bank) {
|
||||
if (item.template != null)
|
||||
this.bankWeight += item.template.item_wt;
|
||||
this.bankWeight += item.template.cacheTemplate.getItemWt();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1707,7 +1707,7 @@ public class CharacterItemManager {
|
||||
while (it.hasNext()) {
|
||||
Item item = it.next();
|
||||
if (item.template != null)
|
||||
this.equipWeight += item.template.item_wt;
|
||||
this.equipWeight += item.template.cacheTemplate.getItemWt();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1715,7 +1715,7 @@ public class CharacterItemManager {
|
||||
this.inventoryWeight = 0;
|
||||
for (Item item : this.inventory) {
|
||||
if (item.template != null)
|
||||
this.inventoryWeight += item.template.item_wt;
|
||||
this.inventoryWeight += item.template.cacheTemplate.getItemWt();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1723,7 +1723,7 @@ public class CharacterItemManager {
|
||||
this.vaultWeight = 0;
|
||||
for (Item item : this.vault) {
|
||||
if (item.template != null)
|
||||
this.vaultWeight += item.template.item_wt;
|
||||
this.vaultWeight += item.template.cacheTemplate.getItemWt();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user