Skip to content

Commit

Permalink
Fix logic in #3155 (#3156)
Browse files Browse the repository at this point in the history
* Fix logic
update comment

* match is functionally identical except returns match instead of index+match

---------

Co-authored-by: thegrb93 <[email protected]>
  • Loading branch information
Denneisk and thegrb93 authored Oct 25, 2024
1 parent 79479dd commit c95c4c6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lua/wire/server/wirelib.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1543,9 +1543,9 @@ function WireLib.SoundExists(path, ply)
-- Limit length and remove invalid chars
path = string.GetNormalizedFilepath(string.gsub(string.sub(path, 1, 260), "[\"?']", ""))

-- Extract sound flags. Only allowed flags are '<', '>', '^', ')'
-- Extract sound flags. See https://developer.valvesoftware.com/wiki/Soundscripts#Sound_characters
local flags, checkpath = string.match(path, "^([^%w_/%.]*)(.*)")
if #flags>2 or string.match(flags, "[#@^<>%^%)}]") then
if #flags > 2 or string.match(flags, "[^#@<>%^%)}]") then
path = checkpath
end

Expand Down

0 comments on commit c95c4c6

Please sign in to comment.