Skip to content

Commit

Permalink
fix: (bpt_doorlock\client\main.lua) accessing undefined variable
Browse files Browse the repository at this point in the history
  • Loading branch information
bitpredator committed Apr 7, 2024
1 parent 4e1f284 commit bf90345
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
local doors = {}

if not LoadResourceFile(lib.name, 'web/build/index.html') then
error('Unable to load UI. Build bpt_doorlock or download the latest release.\n ^3https://github.com/bitpredator/bpt_doorlock/releases/latest/download/bpt_doorlock.zip^0')
end
Expand Down Expand Up @@ -169,13 +171,13 @@ RegisterNetEvent('bpt_doorlock:setState', function(id, state, source, data)

if door.state == state and door.distance and door.distance < 20 then
if Config.NativeAudio then
RequestScriptAudioBank('dlc_oxdoorlock/oxdoorlock', false)
RequestScriptAudioBank('dlc_bptdoorlock/bptdoorlock', false)
local sound = state == 0 and door.unlockSound or door.lockSound or 'door_bolt'
local soundId = GetSoundId()

PlaySoundFromCoord(soundId, sound, door.coords.x, door.coords.y, door.coords.z, 'DLC_OXDOORLOCK_SET', false, 0, false)
PlaySoundFromCoord(soundId, sound, door.coords.x, door.coords.y, door.coords.z, 'DLC_BPTDOORLOCK_SET', false, 0, false)
ReleaseSoundId(soundId)
ReleaseNamedScriptAudioBank('dlc_oxdoorlock/oxdoorlock')
ReleaseNamedScriptAudioBank('dlc_bptdoorlock/bptdoorlock')
else
local volume = (0.01 * GetProfileSetting(300)) / (door.distance / 2)
if volume > 1 then volume = 1 end
Expand Down

0 comments on commit bf90345

Please sign in to comment.