Skip to content

Commit

Permalink
[Unreal] Fix crash when simulating pathing.
Browse files Browse the repository at this point in the history
The Steam Audio Probe Volume actor that the Steam Audio Source component points to
via TSoftObjectPtr ended up different from the Probe Volume actor that
BeginPlay gets called on, so an invalid IPLProbeBatch ended up getting
passed to the simulator.

Fixes: #265
  • Loading branch information
lakulish committed Mar 18, 2024
1 parent bd4682c commit ed7086a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ void USteamAudioSourceComponent::SetInputs(IPLSimulationFlags Flags)
{
Inputs.flags = static_cast<IPLSimulationFlags>(Inputs.flags | IPL_SIMULATIONFLAGS_REFLECTIONS);
}
if (bSimulatePathing && PathingProbeBatch.IsValid())
if (bSimulatePathing && PathingProbeBatch)
{
Inputs.flags = static_cast<IPLSimulationFlags>(Inputs.flags | IPL_SIMULATIONFLAGS_PATHING);
}
Expand Down Expand Up @@ -106,7 +106,7 @@ void USteamAudioSourceComponent::SetInputs(IPLSimulationFlags Flags)

if (PathingProbeBatch)
{
Inputs.pathingProbes = PathingProbeBatch.Get()->GetProbeBatch();
Inputs.pathingProbes = PathingProbeBatch->GetProbeBatch();
}

Inputs.bakedDataIdentifier = GetBakedDataIdentifier();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ class STEAMAUDIO_API USteamAudioSourceComponent : public UActorComponent

/** The probe volume within which to simulate pathing. Only if simulating pathing. */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = PathingSettings)
TSoftObjectPtr<ASteamAudioProbeVolume> PathingProbeBatch;
ASteamAudioProbeVolume* PathingProbeBatch;

/** If true, baked paths are checked for occlusion by dynamic geometry. Only if simulating pathing. */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = PathingSettings)
Expand Down

0 comments on commit ed7086a

Please sign in to comment.