Read defense, bulk and primary attr from the cache ItemTemplate

item_defense_rating, item_bulk_factor and item_primary_attr are
Item-only fields, not on CObjectTemplate, so their consumers read
engine.parsers.objects.ItemTemplate._items by templateID, like the
RuneTemplate and DeedTemplate consumers. The primary attr checks
compare with == because the cache template leaves the attr null
(legacy: None) on non-weapons.

Parity (offline, scripts/p14.py, 7586 templates): 0 differences in
item_defense_rating, item_bulk_factor and item_primary_attr. Every DB
ARMOR and WEAPON template is in the ITEM folder, so both sides gate
these fields on the same templates. 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:
MagicBotandClaude Opus 5.5 committed 2026-10-19 12:45:59 -04:00
1 parent d197f62c1f
commit 9a10574e59
3 files changed
+10 -10

No files matched your search

+1 -1
View File
@@ -1356,7 +1356,7 @@ public class PlayerCharacter extends AbstractCharacter {
ItemTemplate ab = armor.template;
if (ab == null)
return 0f;
return ab.item_bulk_factor;
return engine.parsers.objects.ItemTemplate._items.get(armor.templateID).item_bulk_factor;
}
public static void InitializeSkillsOnLoad(PlayerCharacter pc) {