Skip to content

Fix cumulative level effects on ragdolls without a character view - #496

Merged
MSchmoecker merged 1 commit into
Valheim-Modding:devfrom
tvongaza:fix/creature-level-effects-null-view
Oct 31, 2026
Merged

MSchmoecker merged 1 commit into
Valheim-Modding:devfrom
tvongaza:fix/creature-level-effects-null-view

Conversation

@tvongaza

@tvongaza tvongaza commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Problem

A level-3 Seal ragdoll can run LevelEffects.SetupLevelVisualization without a Character or ZNetView. If another mod has registered a custom creature, Jötunn's global cumulative-effects postfix dereferences that missing view and interrupts the Seal's death sequence. See #494.

Change

Return from the cumulative-effects postfix when LevelEffects, its Character, or its ZNetView is absent. Valid custom creatures keep the existing level-3+ behavior.

Validation

  • Built JotunnLib and JotunnTests Release against Valheim 1.0.16 assemblies; 28 JotunnTests passed under Mono.
  • Ran an automated pinned native A/B check in Valheim 1.0.16 with RtDOcean 2.2.49. A ValheimTesting SystemTest owned client hosted the same disposable fixture world in each arm, spawned one frozen level-3 Seal, confirmed its ZDO existed, and dealt lethal damage through Character.Damage.
  • Unfixed parent f4bb471: the original Seal ZDO remained after 15 seconds, and Unity logged a NullReferenceException in CreatureManager.EnableCumulativeLevelEffects from Character.OnDeath.
  • This fix fac8bd4: the original Seal ZDO disappeared on the first post-damage census; the hosted-world test passed and the client quit cleanly. The Jötunn DLL was the only A/B change.

Runner source and a build/run recipe are published separately (Program.cs, project file, README). The source contains no fixture, game binaries or private logs. The package-only example builds against Valheim.Testing.Game preview.15. The native A/B used the same scenario logic with a local project reference and two extra absent-plugin pins for station isolation; the public example omits those unrelated checks and has not been rerun in game. Reproducing the run requires a disposable Valheim 1.0.16 fixture and our pinned ValheimCLI fork, as detailed there.

This checks the reported Seal death/cleanup path. It does not assert loot distribution or every custom-creature death path.

@tvongaza
tvongaza marked this pull request as ready for review October 1, 2026 02:50
@MSchmoecker
MSchmoecker merged commit 6f140eb into Valheim-Modding:dev Oct 31, 2026
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.

2 participants