Skip to content

Fix duplicate CompProperties_Styleable on inherited ThingDefs#15

Open
Evyatar108 wants to merge 1 commit into
juanosarg:mainfrom
Evyatar108:fix/duplicate-compstyleable
Open

Fix duplicate CompProperties_Styleable on inherited ThingDefs#15
Evyatar108 wants to merge 1 commit into
juanosarg:mainfrom
Evyatar108:fix/duplicate-compstyleable

Conversation

@Evyatar108
Copy link
Copy Markdown

@Evyatar108 Evyatar108 commented Mar 29, 2026

Summary

  • Several MakingFurnitureStyleable patches (1.6) add CompProperties_Styleable to ThingDefs that already inherit it from abstract parents (ResourceBase, TableBase)
  • The XPath conditional check (comps/li[@Class="CompProperties_Styleable"]) only inspects direct XML children and does not resolve RimWorld's XML inheritance (ParentName)
  • This creates duplicate CompStyleable components, which write duplicate <sourcePrecept> entries on save, causing load errors: Could not load reference to Verse.Precept named null

Affected defs (1.6)

Patch file ThingDefs Inherits CompStyleable from
ComponentsPatch.xml ComponentIndustrial, ComponentSpacer ResourceBase
EndTablePatch.xml EndTable TableBase

Note: Only 1.6 patches are modified. The 1.5 inheritance chains were not verified and are left unchanged.

Fix

Removed the redundant PatchOperationConditional blocks for these defs since they already have CompStyleable via their parent chain. The empty <Patch> elements are kept with comments explaining why.

Test plan

  • Loaded modded save with bookcases, end tables, and components
  • Confirmed sourcePrecept duplicate errors no longer appear on load
  • Built new Bookcase, saved, reloaded — no errors

Several MakingFurnitureStyleable patches add CompProperties_Styleable
to ThingDefs that already inherit it from abstract parents:

- ComponentIndustrial/ComponentSpacer inherit from ResourceBase
- EndTable inherits from TableBase

The XPath conditional check (`comps/li[@Class="CompProperties_Styleable"]`)
only inspects direct XML children and does not resolve RimWorld's XML
inheritance (ParentName). This causes duplicate CompStyleable components,
which write duplicate <sourcePrecept> entries during save. On load,
the second <sourcePrecept> collides with the next XML element, producing
errors like:

  Could not load reference to Verse.Precept named null

This patch removes the redundant operations for these defs since they
already have CompStyleable via their parent chain.

Only 1.6 patches are modified — 1.5 inheritance was not verified.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Evyatar108 Evyatar108 force-pushed the fix/duplicate-compstyleable branch from e387f97 to f697ed3 Compare March 29, 2026 07:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant