GarwelGarwel / Celsius

RimWorld mod adding realistic thermodynamics
4 stars 7 forks source link

Possible DefModExtensions inherit workaround #48

Open Poeteca opened 5 months ago

Poeteca commented 5 months ago

The below appears to be a nondestructive way of preventing unintended inheritance issue like what is seen in Insolation (Continued), Medieval Overhaul, and a few other mods. Based off of my testing, this proposed patch method does not interfere with other modExtension classes, and it cannot be used in-place of the normal AddModExtension patch.

This could also still be a bad idea to implement in Celsius itself, but I lack the experience to make that determination.

<Operation Class="PatchOperationAdd">
    <xpath>...</xpath>
    <value>
        <modExtensions Class="Celsius.ThingThermalProperties" Inherit="false"></modExtensions>
    </value>
</Operation>

Example implementation using Insolation (Continued):

<Operation Class="PatchOperationAdd">
    <success>Always</success>
    <xpath>Defs/ThingDef[@Name="INSWall_Base"]</xpath>
    <value>
        <modExtensions Class="Celsius.ThingThermalProperties" Inherit="false"></modExtensions>
    </value>
</Operation>
GarwelGarwel commented 4 months ago

I think I've experimented with it and it didn't work. But I may be wrong here, so will give it another try.