Page MenuHomeFeedback Tracker

SoundSet Crash Reports
Closed, ResolvedPublic

Description

Hi,

So recently made a SoundReverse sound and sounds for air brakes etc, all working fine in game and works intended but as you play the airbrakes, a crash log report is generated for NULL instance but no crashes for client or server

It seems to be when overriding the OnBrakesPressed and OnBrakesReleased

Details

Severity
Minor
Resolution
Open
Reproducibility
Always
Operating System
Windows 10 x64
Category
Other
Steps To Reproduce

Add the following to a .c for a vehicle

	void SoundAirBrakes()
	{
		PlaySoundSet(m_AirBrake, SOUND_AIR_BRAKES, 0, 0);
		m_AirBrake.SetSoundAutodestroy( true );
	}

	void SoundAirRelease()
	{
		PlaySoundSet(m_AirRelease, SOUND_AIR_RELEASE, 0, 0);
		m_AirRelease.SetSoundAutodestroy( true );
	}

	override void OnBrakesPressed()
	{
		super.OnBrakesPressed();

		if (EngineIsOn())
		{
			SoundAirBrakes();
		}
	}

	override void OnBrakesReleased()
	{
		super.OnBrakesReleased();

		UpdateLights();

		if ( EngineIsOn())
		{
			SoundAirRelease();
		}
	}

Event Timeline

Callatic created this task.Apr 12 2022, 8:02 PM
Callatic changed Category from General to Other.
Geez changed the task status from New to Reviewed.EditedApr 13 2022, 10:00 AM
Geez added a subscriber: Geez.

Hello Callatic.
Calling SetSoundAutodestroy( true ); is redundant after PlaySoundSet call.
Also, PlaySoundSet returns bool that should not be ignored as it is telling the caller whether it is safe to touch the EffectSound returned in its first parameter.
We suppose that if you remove the lines with SetSoundAutodestroy( true ); it could possibly work.
Regards,
Geez

Hi Geez,

I can confirm that fixed the problem, thank you.

Thanks,
Callatic

Geez closed this task as Resolved.Apr 19 2022, 2:23 PM
Geez claimed this task.