Closed Hawkbat closed 1 month ago
For Wrong Warp, we've fixed this by dynamically reassigning the raft's alignment fluid with the following patch:
[HarmonyPrefix, HarmonyPatch(typeof(AlignToSurfaceFluidDetector), nameof(AlignToSurfaceFluidDetector.OnVolumeActivated))]
public static void AlignToSurfaceFluidDetector_OnVolumeActivated(AlignToSurfaceFluidDetector __instance, PriorityVolume volume)
{
if (!WrongWarpMod.Instance.IsInWrongWarpSystem) return;
if (__instance is not RaftFluidDetector) return;
if (volume is FluidVolume fluidVolume)
{
__instance._alignmentFluid = fluidVolume;
}
}
But I haven't tested extensively to see if this would negatively impact the existing rafts in the Stranger or Dream World.
What Happened?
Currently rafts spawned using the dedicated
rafts
prop module always assume that the primary water fluid volume used to align the raft upward will be the planet's spherical water volume (set using theWater
planet module). If the raft enters a customRadialFluidVolume
made using thefluidVolumes
volume module or in Unity, it will use the planet's water volume for alignment instead of the custom volume. This usually causes the raft to consider itself never submerged, tumble wildly, and be uncontrollable.If the planet has no planetary water volume at all, the raft instead throws a
NullReferenceException
error everyFixedUpdate()
because__instance._fluidDetector._alignmentFluid
is null, and exhibits similar weird physics behavior.What was supposed to happen?
The raft should not throw errors or behave strangely when entering a non-planet-sphere water volume.
Platform
Steam
Mods
Logs
No response