Fix spaces not allowed in dupe name. Fixes: #379 (#381)

This commit is contained in:
thegrb93 2022-02-02 15:38:11 -05:00 committed by GitHub
parent 0877ff1bc3
commit 33dfc6e034
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -113,13 +113,7 @@ local function AdvDupe2_ReceiveFile(len, ply)
if not IsValid(ply) then return end
if not ply.AdvDupe2 then ply.AdvDupe2 = {} end
local name = net.ReadString()
local _1, _2, _3 = string.find(name, "([%w_]+)")
if _3 then
ply.AdvDupe2.Name = string.sub(_3, 1, 32)
else
ply.AdvDupe2.Name = "Advanced Duplication"
end
ply.AdvDupe2.Name = string.match(net.ReadString(), "([%w_ ]+)") or "Advanced Duplication"
local stream = net.ReadStream(ply, function(data)
if data then