Skip to content

Commit

Permalink
Fixed sound volume being a boolean
Browse files Browse the repository at this point in the history
- Fixed a case where the sound volume would sometimes be parsed as a boolean.
  • Loading branch information
TwistedTail committed Jun 23, 2024
1 parent 174e22d commit b96cef6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lua/weapons/gmod_tool/stools/acfsound.lua
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ local function ReplaceSound(_, Entity, Data)

Support.SetSound(Entity, {
Sound = Sound,
Pitch = Pitch or 1,
Volume = Volume or 1,
Pitch = ACF.CheckNumber(Pitch, 1),
Volume = ACF.CheckNumber(Volume, 1),
})

duplicator.StoreEntityModifier(Entity, "acf_replacesound", { Sound, Pitch or 1, Volume or 1 })
Expand Down Expand Up @@ -165,8 +165,8 @@ function TOOL:LeftClick(trace)

if not IsReallyValid(trace, owner) then return false end
local sound = owner:GetInfo("wire_soundemitter_sound")
local pitch = owner:GetInfo("acfsound_pitch")
local volume = owner:GetInfo("acfsound_volume")
local pitch = owner:GetInfoNum("acfsound_pitch", 1)
local volume = owner:GetInfoNum("acfsound_volume", 1)

ReplaceSound(owner, trace.Entity, { sound, pitch, volume })

Expand Down

0 comments on commit b96cef6

Please sign in to comment.