You are viewing a potentially older version of this package. View all versions.
sighsorry-Blasted_Swimming_Tarred_Bug_Fix-1.1.1 icon

Blasted Swimming Tarred Bug Fix

Defensive runtime fixes for stale water and tar state, LiquidVolume raycast array lifetime, and scene object cleanup.

Date uploaded 11 hours ago
Version 1.1.1
Download link sighsorry-Blasted_Swimming_Tarred_Bug_Fix-1.1.1.zip
Downloads 21
Dependency string sighsorry-Blasted_Swimming_Tarred_Bug_Fix-1.1.1

This mod requires the following mods to function

denikson-BepInExPack_Valheim-5.4.2333 icon
denikson-BepInExPack_Valheim

BepInEx pack for Valheim. Preconfigured with the correct entry point for mods and preferred defaults for the community.

Preferred version: 5.4.2333

README

BlastedSwimmingTarredBugFix


Defensive runtime fixes for stale liquid state, tar-pit raycast jobs, and scene object cleanup.

What It Fixes

  • Random swimming while nowhere near water.
  • Random tarred state after leaving a Plains tar pit.
  • Portal, dungeon, or scene transitions leaving old liquid state behind.
  • Carts or floating objects keeping water/tar state after a missed trigger exit.
  • Long-lived LiquidVolume raycast arrays using a short-lived allocator.
  • Scene cleanup failing on missing, destroyed, or mismatched ZNetView data.

How It Works

Valheim liquid volumes keep a list of objects currently inside water or tar. If OnTriggerExit is missed, an old WaterVolume or LiquidSurface can keep sending positive SetLiquidLevel(...) updates to an object that already left.

This mod keeps the fix narrow:

  • Reject stale positive liquid updates when the source no longer overlaps the target.
  • Remove stale entries from WaterVolume and LiquidSurface before floater updates.
  • Clamp water/tar counters so missed exits cannot drive them below zero.
  • Clear purged stale liquid state only when no current liquid trigger overlaps the target.
  • Clear player liquid state after a teleport successfully starts; destination triggers restore it if the player arrives in liquid.
  • Keep LiquidVolume raycast arrays valid for their full lifetime and dispose them safely.
  • Clean up stale scene entries without dereferencing missing ZDO or ZNetView data.

Compatibility

The integrated lifetime patch is skipped when MyPitsDontLeak is loaded. The integrated scene cleanup patch is skipped when Scenic is loaded. Other protections remain active.

Release Packaging

Update only LiquidStuckFixPlugin.ModVersion, then run:

dotnet build -c Release

The Release build syncs that version into Thunderstore/manifest.json, validates the manifest, merges ServerSync, and creates Thunderstore/BlastedSwimmingTarredBugFix-{version}.zip. Include the synced manifest change in the release commit.

Configuration

Only four options are exposed:

[General]
LockConfiguration = true
Enabled = true
BoundsPadding = 0.75

[Debug]
DebugLogging = false

Enabled turns all runtime protection on or off.

LockConfiguration lets the server control synced options.

BoundsPadding adds a small margin to liquid/target bounds checks. Keep the default unless legitimate shallow water or tar is rejected.

DebugLogging logs rejected liquid updates and stale purges. Leave it off during normal play.

Credits

Github

https://github.com/sighsorry1029/BlastedSwimmingTarredBugFix

CHANGELOG

Version Update Notes
1.1.1 - Preserve ZDO recreation and prevent partial scene cleanup reprocessing
- Harden mixed-liquid validation and automate versioned Thunderstore packaging
1.1.0 - Add integrated LiquidVolume lifetime and ZNetScene cleanup protections
- Harden liquid source validation, mixed-liquid recovery, and release packaging
1.0.3 - Fix random swimming regression in Plains and Mistlands
- Add throttled local-player stale liquid recovery
1.0.2 - Refactoring and optimizations
- Restore guarded local-player stale liquid recovery
1.0.0 - Initial Release