Handle SteamID64 not always returning anything

Player [13][redacted] ERR: [Cmd] 'pac_wear_parts' failed:   lua/pac3/editor/client/wear_filter.lua:184: wrong number of arguments to 'insert'
This commit is contained in:
Python1320 2022-03-28 21:56:28 +03:00 committed by GitHub
parent 815deaaf11
commit cc7c0a7320
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -25,7 +25,12 @@ function pac.Hash(obj)
return "bot " .. tostring(obj:EntIndex())
end
return steamid64(obj)
local hash = steamid64(obj)
if not hash then
ErrorNoHalt( "FIXME: Did not get a steamid64 for a player object " .. tostring(obj) .. ', valid=' .. tostring(IsValid(obj)) .. '\n' )
hash = "0"
end
return hash
elseif t == "number" then
return string_hash(tostring(t))
elseif t == "table" then