RimWorld

RimWorld

Medieval Overhaul
Phant0m5 28 maj, 2022 @ 23:25
Compatibility fix for research bench
If you get an error about duplicate nodes on startup, and your simple research benches don't connect to the Medieval Overhaul bookshelves that are supposed to provide a research speed boost, this is why.

(this mod's folder)/1.3/Patches/Add_AffectedByFacilities_SimpleResearchBench.xml doesn't check to see if the xml nodes it's adding already exist from other mods. This is all the same code, just in stages and inside a couple checks so it only adds the lines it actually needs to.

<?xml version="1.0" encoding="utf-8"?>
<Patch>
<Operation Class="PatchOperationConditional">
<xpath>/Defs/ThingDef[defName="SimpleResearchBench"]/comps</xpath>
<match Class="PatchOperationConditional">
<xpath>/Defs/ThingDef[defName="SimpleResearchBench"]/comps/li[@Class="CompProperties_AffectedByFacilities"]</xpath>
<match Class="PatchOperationAdd">
<xpath>/Defs/ThingDef[defName="SimpleResearchBench"]/comps/li[@Class="CompProperties_AffectedByFacilities"]/linkableFacilities</xpath>
<value>
<li>DankPyon_RusticBookshelf</li>
</value>
</match>
<nomatch Class="PatchOperationAdd">
<xpath>/Defs/ThingDef[defName="SimpleResearchBench"]/comps</xpath>
<value>
<li Class="CompProperties_AffectedByFacilities">
<linkableFacilities>
<li>DankPyon_RusticBookshelf</li>
</linkableFacilities>
</li>
</value>
</nomatch>
</match>
<nomatch Class="PatchOperationAdd">
<xpath>/Defs/ThingDef[defName="SimpleResearchBench"]</xpath>
<value>
<comps>
<li Class="CompProperties_AffectedByFacilities">
<linkableFacilities>
<li>DankPyon_RusticBookshelf</li>
</linkableFacilities>
</li>
</comps>
</value>
</nomatch>
</Operation>
</Patch>
< >
Visar 1-1 av 1 kommentarer
Circus_O 12 aug, 2022 @ 1:27 
That error had been annoying me and I was not bothered learning the code to make this happen, so thank you!
< >
Visar 1-1 av 1 kommentarer
Per sida: 1530 50