Skip to content

Adaptive Primitive Storage patch #2

@TeflonJim

Description

@TeflonJim

I'd PR it, but your repo is not up to date with what you have released.

Applies to 1.5 and 1.6. A presumptive patch for Adaptive Primitive Storage ferny.xml is:

<?xml version="1.0" encoding="utf-8"?>
<Patch>
    <Operation Class="PatchOperationFindMod">
        <mods>
            <li>Adaptive Primitive Storage</li>
        </mods>
        <match Class="PatchOperationSequence">
            <operations>
                <li Class="PatchOperationAdd">
                    <xpath>Defs/ThingDef[defName="ASF_CellarWood"]</xpath>
                    <value>
                        <researchPrerequisites>
                            <li>VFET_Construction</li>
                        </researchPrerequisites>
                    </value>
                </li>
                <li Class="PatchOperationAdd">
                    <xpath>Defs/ThingDef[defName="ASF_CoveredClayPot"]</xpath>
                    <value>
                        <researchPrerequisites>
                            <li>VFET_Construction</li>
                        </researchPrerequisites>
                    </value>
                </li>
                <li Class="PatchOperationAdd">
                    <xpath>Defs/ThingDef[defName="ASF_UncoveredClayPot"]</xpath>
                    <value>
                        <researchPrerequisites>
                            <li>VFET_Construction</li>
                        </researchPrerequisites>
                    </value>
                </li>
                <li Class="PatchOperationAdd">
                    <xpath>Defs/ThingDef[defName="ASF_MeatRack"]</xpath>
                    <value>
                        <researchPrerequisites>
                            <li>VFET_Construction</li>
                        </researchPrerequisites>
                    </value>
                </li>
                <li Class="PatchOperationAdd">
                    <xpath>Defs/ThingDef[defName="ASF_StoragePit"]</xpath>
                    <value>
                        <researchPrerequisites>
                            <li>VFET_Construction</li>
                        </researchPrerequisites>
                    </value>
                </li>
                <li Class="PatchOperationAdd">
                    <xpath>Defs/ThingDef[defName="ASF_WeaponRack"]</xpath>
                    <value>
                        <researchPrerequisites>
                            <li>VFET_Construction</li>
                        </researchPrerequisites>
                    </value>
                </li>

                <li Class="PatchOperationAdd">
                    <xpath>Defs/ThingDef[defName="ASF_WovenBasket"]</xpath>
                    <value>
                        <researchPrerequisites>
                            <li>VFET_Construction</li>
                        </researchPrerequisites>
                    </value>
                </li>
                <li Class="PatchOperationAdd">
                    <xpath>Defs/ThingDef[defName="ASF_WovenBasketDouble"]</xpath>
                    <value>
                        <researchPrerequisites>
                            <li>VFET_Construction</li>
                        </researchPrerequisites>
                    </value>
                </li>
                <li Class="PatchOperationAdd">
                    <xpath>Defs/ThingDef[defName="ASF_WovenBasketTriple"]</xpath>
                    <value>
                        <researchPrerequisites>
                            <li>VFET_Construction</li>
                        </researchPrerequisites>
                    </value>
                </li>
                <li Class="PatchOperationAdd">
                    <xpath>Defs/ThingDef[defName="ASF_Granary"]</xpath>
                    <value>
                        <researchPrerequisites>
                            <li>VFET_Construction</li>
                        </researchPrerequisites>
                    </value>
                </li>
                <li Class="PatchOperationAdd">
                    <xpath>Defs/ThingDef[defName="ASF_StorageTent"]</xpath>
                    <value>
                        <researchPrerequisites>
                            <li>VFET_Construction</li>
                        </researchPrerequisites>
                    </value>
                </li>
            </operations>
        </match>
    </Operation>
</Patch>

If there was a reason to use Replace rather than Add, it can be made safe using a pattern like this, depending on how far you want to go:

<li Class="PatchOperationConditional">
    <xpath>Defs/ThingDef[defName="ASF_StorageTent"]/researchPrerequisites</xpath>
    <match Class="PatchOperationReplace">
        <xpath>Defs/ThingDef[defName="ASF_StorageTent"]/researchPrerequisites</xpath>
        <value>
            <researchPrerequisites>
	        <li>VFET_Construction</li>
           </researchPrerequisites>
        </value>
    </match>
    <nomatch Class="PatchOperationAdd">
        <xpath>Defs/ThingDef[defName="ASF_StorageTent"]</xpath>
        <value>
            <researchPrerequisites>
	        <li>VFET_Construction</li>
           </researchPrerequisites>
        </value>
    </nomatch>
</li>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions