Skip to content

VEF's PawnRenderNode_Fur.GraphicFor patch bypasses vanilla fallback logic, causing rendering errors #194

Open

Description

@SharpIceX

When a pawn possesses a gene with VEF's GeneExtension attached while pawn.story.furDef is null, a rendering exception is triggered. This causes all pawns on screen to disappear and can occasionally lead to screen flickering or visual artifacts.

Version

  • Game Version: 1.6.4871
  • Biotech DLC Version: Build 23969874 (Steam Build ID)
  • Harmony Version: 3.0.1.0
  • Vanilla Expanded Framework: 16e8ec4

Minimal Reproduction Mod: https://github.com/SharpIceX/repro-cases/tree/360669bc6b8fe10b054fd49ccd1680a99f680f81/github/Vanilla-Expanded/VanillaExpandedFramework/1

Steps to Reproduce

  1. Create a mod containing the following gene Def snippet:
<?xml version="1.0" encoding="utf-8"?>
<Defs>
    <GeneDef>
        <defName>BUg_Gene</defName>
        <label>Bug Gene</label>
        <iconPath>UI/Icons/Xenotypes/Other</iconPath>
        <renderNodeProperties>
            <li>
                <nodeClass>PawnRenderNode_Fur</nodeClass>
                <workerClass>PawnRenderNodeWorker_Fur</workerClass>
                <baseLayer>10</baseLayer>
            </li>
        </renderNodeProperties>
        <modExtensions>
            <li Class="VEF.Genes.GeneExtension">
                <useMaskForFur>true</useMaskForFur>
            </li>
        </modExtensions>
    </GeneDef>
</Defs>
  1. Load order: Enable Harmony, Core, Biotech, Vanilla Expanded Framework, and the test mod containing the gene above.
  2. Start or load a game, then apply this gene to any pawn using Development Mode.
  3. The rendering exception triggers immediately.

Rendering Error:

Image

Expected Behavior

The patch should preserve vanilla RimWorld's built-in fallback check:

	public override Graphic GraphicFor(Pawn pawn)
	{
		if (!ModLister.CheckBiotech("Fur"))
		{
			return null;
		}
		if (pawn.story?.furDef == null)
		{
			return null;
		}
		return GraphicDatabase.Get<Graphic_Multi>(pawn.story?.furDef.GetFurBodyGraphicPath(pawn), ShaderFor(pawn), Vector2.one, ColorFor(pawn));
	}

When pawn.story.furDef is null, the method should return null safely without causing any rendering errors:

Image

Additionally, I noticed that the Vanilla Expanded Framework repository is licensed under CC BY-NC-ND 4.0, which includes the NoDerivatives (ND) clause. I’d be happy to submit a pull request to help fix this issue, but I’m unsure whether this license imposes any restrictions on submitting contributions. Could you clarify whether community contributions via PRs are welcome under this license?

Also, I was wondering if updates are still being released for version 1.6?

Activity

  1. SharpIceX commented on Oct 25, 2026

    @SharpIceX
    Author

    fix: ab7b5da

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions