Skip to content

Commit

Permalink
Replaced [Get/Set]NWString with [Get/Set]NWFloat in some cases
Browse files Browse the repository at this point in the history
- Replaced [Get/Set]NWString with [Get/Set]NWFloat on the weapon muzzleflash's sound pitch and volume variables.
  • Loading branch information
TwistedTail committed May 20, 2024
1 parent 0480083 commit c8ffc03
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions lua/effects/acf_muzzle_flash.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ function EFFECT:Init(Data)
local Propellant = Data:GetScale()
local ReloadTime = Data:GetMagnitude()
local Sound = Gun:GetNWString("Sound")
local Pitch = Gun:GetNWString("SoundPitch")
local Volume = Gun:GetNWString("SoundVolume")
local Pitch = Gun:GetNWFloat("SoundPitch")
local Volume = Gun:GetNWFloat("SoundVolume")
local Class = Gun:GetNWString("Class")
local ClassData = Weapons.Get(Class)
if not ClassData then return end
Expand Down
4 changes: 2 additions & 2 deletions lua/entities/acf_gun/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ do -- Spawn and Update functions --------------------------------
-- Set NWvars
Entity:SetNWString("WireName", "ACF " .. Entity.Name)
Entity:SetNWString("Sound", Entity.SoundPath)
Entity:SetNWString("SoundPitch", Entity.SoundPitch)
Entity:SetNWString("SoundVolume", Entity.SoundVolume)
Entity:SetNWFloat("SoundPitch", Entity.SoundPitch)
Entity:SetNWFloat("SoundVolume", Entity.SoundVolume)
Entity:SetNWString("Class", Entity.Class)

-- Adjustable barrel length
Expand Down
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 @@ -40,17 +40,17 @@ Sounds.acf_gun = {
ent.SoundVolume = soundData.Volume

ent:SetNWString("Sound", soundData.Sound)
ent:SetNWString("SoundPitch", soundData.Pitch)
ent:SetNWString("SoundVolume", soundData.Volume)
ent:SetNWFloat("SoundPitch", soundData.Pitch)
ent:SetNWFloat("SoundVolume", soundData.Volume)
end,
ResetSound = function(ent)
ent.SoundPath = ent.DefaultSound
ent.SoundPitch = 1
ent.SoundVolume = 1

ent:SetNWString("Sound", ent.DefaultSound)
ent:SetNWString("SoundPitch", 1)
ent:SetNWString("SoundVolume", 1)
ent:SetNWFloat("SoundPitch", 1)
ent:SetNWFloat("SoundVolume", 1)
end
}

Expand Down

0 comments on commit c8ffc03

Please sign in to comment.