mirror of
https://github.com/chev2/gmod-addons.git
synced 2025-12-17 13:32:14 +00:00
SprayMesh Extended: Don't let player spray on skybox or clip brushes
This commit is contained in:
parent
3940c88a10
commit
2fca8094ba
1 changed files with 9 additions and 2 deletions
|
|
@ -107,6 +107,13 @@ function PLAYER:AllowImmediateDecalPainting(allow)
|
|||
return OldAllowImmediateDecalPainting(self, allow)
|
||||
end
|
||||
|
||||
local TOOL_TEXTURES = {
|
||||
["tools/toolsinvisible"] = true,
|
||||
["tools/toolsskybox"] = true,
|
||||
["tools/toolsskybox2d"] = true,
|
||||
["tools/toolsclip"] = true
|
||||
}
|
||||
|
||||
-- The default, built-in spray gets overriden here
|
||||
hook.Add("PlayerSpray", "SprayMesh.OverrideNativeSpray", function(ply)
|
||||
spraymesh.DebugPrint("playerspray")
|
||||
|
|
@ -136,8 +143,8 @@ hook.Add("PlayerSpray", "SprayMesh.OverrideNativeSpray", function(ply)
|
|||
end
|
||||
})
|
||||
|
||||
-- No spraying on invisible walls
|
||||
if tr.HitTexture:lower() == "tools/toolsinvisible" then return true end
|
||||
-- No spraying on invisible walls/tool textures
|
||||
if TOOL_TEXTURES[tr.HitTexture:lower()] then return true end
|
||||
|
||||
ply.LastSprayTime = CurTime()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue