project-error / npwd

NPWD is a FiveM phone resource written entirely in TypeScript and React.
https://projecterror.dev
Other
351 stars 275 forks source link

fix(game/sounds): release sound ids #1078

Closed lukealford closed 11 months ago

lukealford commented 1 year ago

Pull Request Description

Bug

FiveM has a limit of about 100 active soundIDs, if you don't correctly release a soundID you end up with a -1 ID which ends up muting any native sounds, even native sounds outside the scope of this resource(e.g. police sirens).

Solution

Correctly release sounds IDs after use or before creating a new one.

I've also included the same fix from #1027

Pull Request Checklist: