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
@@ -75,7 +75,7 @@ public class Item extends AbstractWorldObject {
|
||||
this.containerType = ItemContainerType.NONE;
|
||||
this.numberOfItems = 1;
|
||||
this.flags.addAll(this.template.item_flags);
|
||||
this.value = this.template.item_value;
|
||||
this.value = this.template.cacheTemplate.getItemValue();
|
||||
this.magicValue = this.value + calcMagicValue();
|
||||
loadTemplateEnchantments();
|
||||
}
|
||||
@@ -166,7 +166,7 @@ public class Item extends AbstractWorldObject {
|
||||
this.value = rs.getInt("value");
|
||||
|
||||
if (this.value == 0) {
|
||||
this.value = this.template.item_value;
|
||||
this.value = this.template.cacheTemplate.getItemValue();
|
||||
this.magicValue = this.value + calcMagicValue();
|
||||
} else
|
||||
this.magicValue = this.value; // Value was overridden in vendor inventory
|
||||
@@ -255,7 +255,7 @@ public class Item extends AbstractWorldObject {
|
||||
} else
|
||||
writer.putInt(item.numberOfItems); // Amount of gold
|
||||
} else
|
||||
writer.putInt(item.template.item_value);
|
||||
writer.putInt(item.template.cacheTemplate.getItemValue());
|
||||
|
||||
writer.putInt(item.getValue());
|
||||
|
||||
@@ -955,7 +955,7 @@ public class Item extends AbstractWorldObject {
|
||||
// No enchantments for negative id items in the db. Early exit.
|
||||
|
||||
if (this.objectUUID < 0) {
|
||||
this.magicValue = this.template.item_value + calcMagicValue();
|
||||
this.magicValue = this.template.cacheTemplate.getItemValue() + calcMagicValue();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -971,8 +971,8 @@ public class Item extends AbstractWorldObject {
|
||||
|
||||
// Value is overridden the db
|
||||
|
||||
if (this.value == this.template.item_value)
|
||||
this.magicValue = this.template.item_value + calcMagicValue();
|
||||
if (this.value == this.template.cacheTemplate.getItemValue())
|
||||
this.magicValue = this.template.cacheTemplate.getItemValue() + calcMagicValue();
|
||||
}
|
||||
|
||||
public void addPermanentEnchantment(String enchantID, int rank) {
|
||||
|
||||
Reference in new issue
Block a user