HaodongMo / ArcCW

57 stars 35 forks source link

Silencers don't seem to silence people's screams in TTT2 #150

Closed GermanPlasma closed 1 year ago

GermanPlasma commented 1 year ago

I know the issue with the weapon sounds takes priority, but I wanted to report this bug for some time now, I apologize ^^"

My test setup has Arccw running with TTT2, weapons spawn with random attachments (and silencers can be found as entities around the map, though internal silencers still spawn randomly on the weapons)

I have looked at the code and it seems like the following snipped within sh_ttt.lua has something to do with it:

function SWEP:TTT_PostAttachments()
    self.IsSilent = self:GetBuff_Override("Suppressor")

    if !self.IsSilent and self:GetBuff("ShootVol") <= 90 then
        self.IsSilent = true
    end
end

After changing it to something like

function SWEP:TTT_PostAttachments()
    self.silence = self:GetBuff_Override("Silencer")

    if !self.silence then
        self.IsSilent = true
    end
end

(removed the shootvol as I couldn't get that to work at all) it seems to partially work, but with two exceptions:

  1. Weapons with internal silencers need to have their silencer unequipped, then requipped to silence screams
  2. Once a silencer is manually attached to a weapon, unattaching it results in screams still being silenced.

I do believe part of the issue is that the buff ("Suppressor") doesn't seem to exist, but ("Silencer") does. Maybe I am misunderstanding something though.