mirror of
https://github.com/wiremod/wire.git
synced 2025-03-04 03:03:04 -05:00
exploit patch (#2975)
* soundemitter and soundPlay patched * this is better + fix emitsound * more efficient order + 260 char limit instead * emitsound invalid character check
This commit is contained in:
parent
33fa54337a
commit
730d702e5a
@ -71,12 +71,11 @@ local function soundStop(self, index, fade)
|
||||
end
|
||||
|
||||
local function soundCreate(self, entity, index, time, path, fade)
|
||||
path = string.Trim(string.sub(path, 1, 260))
|
||||
if path:match('["?]') then return end
|
||||
local data = self.data.sound_data
|
||||
if not isAllowed( self ) then return end
|
||||
|
||||
path = path:Trim()
|
||||
path = path:gsub( "\\", "/" )
|
||||
if isnumber( index ) then index = math.floor( index ) end
|
||||
|
||||
local timerid = "E2_sound_stop_" .. self.entity:EntIndex() .. "_" .. index
|
||||
@ -303,7 +302,9 @@ local function EmitSound(e2, ent, snd, level, pitch, volume)
|
||||
level = maxlevel
|
||||
end
|
||||
|
||||
ent:EmitSound(snd, level, pitch, volume)
|
||||
snd = string.sub(snd, 1, 260)
|
||||
if snd:match('["?]') then return end
|
||||
ent:EmitSound(snd, level, pitch, volume)
|
||||
end
|
||||
|
||||
__e2setcost(20)
|
||||
|
@ -159,11 +159,11 @@ end
|
||||
function ENT:SetSound(soundName)
|
||||
self:StopSounds()
|
||||
|
||||
soundName = string.Trim(string.sub(soundName, 1, 260))
|
||||
if soundName:match('["?]') then return end
|
||||
parsedsound = soundName:Trim()
|
||||
util.PrecacheSound(parsedsound)
|
||||
util.PrecacheSound(soundName)
|
||||
|
||||
self.sound = parsedsound
|
||||
self.sound = soundName
|
||||
|
||||
self.SoundProperties = sound.GetProperties(self.sound)
|
||||
if self.SoundProperties then
|
||||
@ -175,7 +175,7 @@ function ENT:SetSound(soundName)
|
||||
WireLib.TriggerOutput(self, "Properties", {})
|
||||
end
|
||||
|
||||
self:SetOverlayText( parsedsound:gsub("[/\\]+","/") )
|
||||
self:SetOverlayText( soundName:gsub("[/\\]+","/") )
|
||||
end
|
||||
|
||||
function ENT:StartSounds()
|
||||
|
Loading…
Reference in New Issue
Block a user