SprayMesh Extended: Add concommand spraymesh_debug_place

Used to place fake player sprays for debugging purposes.

Only works when spraymesh.DEBUG_MODE is enabled.
This commit is contained in:
Chev 2023-11-06 10:39:03 -08:00
parent 995e20125a
commit a5227bd0e7
Signed by: chev2
GPG key ID: BE0CFBD5DCBB2511

View file

@ -995,3 +995,23 @@ concommand.Add("spraymesh_shownames", function(ply, cmd, args, argstr)
print(([[%s %s]]):format(plyStr, URLStr)) print(([[%s %s]]):format(plyStr, URLStr))
end end
end) end)
if spraymesh.DEBUG_MODE then
concommand.Add("spraymesh_debug_place", function()
local tr = LocalPlayer():GetEyeTrace()
local sprayData = {
SteamID64 = "DEBUG_" .. util.SHA1(CurTime()),
PlayerName = "Debug Spray " .. CurTime(),
HitPos = tr.HitPos,
HitNormal = tr.HitNormal,
TraceNormal = tr.Normal,
URL = spraymesh.SPRAY_URL_DEFAULT,
CoordDistance = spraymesh.COORD_DIST_DEFAULT,
SprayTime = CurTime(),
PlaySpraySound = true
}
spraymesh.PlaceSpray(sprayData)
end)
end