mirror of
https://github.com/chev2/gmod-addons.git
synced 2025-12-18 05:52:15 +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)
|
return OldAllowImmediateDecalPainting(self, allow)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local TOOL_TEXTURES = {
|
||||||
|
["tools/toolsinvisible"] = true,
|
||||||
|
["tools/toolsskybox"] = true,
|
||||||
|
["tools/toolsskybox2d"] = true,
|
||||||
|
["tools/toolsclip"] = true
|
||||||
|
}
|
||||||
|
|
||||||
-- The default, built-in spray gets overriden here
|
-- The default, built-in spray gets overriden here
|
||||||
hook.Add("PlayerSpray", "SprayMesh.OverrideNativeSpray", function(ply)
|
hook.Add("PlayerSpray", "SprayMesh.OverrideNativeSpray", function(ply)
|
||||||
spraymesh.DebugPrint("playerspray")
|
spraymesh.DebugPrint("playerspray")
|
||||||
|
|
@ -136,8 +143,8 @@ hook.Add("PlayerSpray", "SprayMesh.OverrideNativeSpray", function(ply)
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
-- No spraying on invisible walls
|
-- No spraying on invisible walls/tool textures
|
||||||
if tr.HitTexture:lower() == "tools/toolsinvisible" then return true end
|
if TOOL_TEXTURES[tr.HitTexture:lower()] then return true end
|
||||||
|
|
||||||
ply.LastSprayTime = CurTime()
|
ply.LastSprayTime = CurTime()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue