Permalink
Browse files

Don't render missing texture overlay

  • Loading branch information...
1 parent d1d9532 commit c45a14ef019520d19e427f4299faa83047e08ba2 @robotboy655 robotboy655 committed Jan 4, 2015
Showing with 4 additions and 4 deletions.
  1. +4 −4 garrysmod/lua/postprocess/overlay.lua
@@ -2,7 +2,7 @@
--[[---------------------------------------------------------
Register the convars that will control this effect
-----------------------------------------------------------]]
-local pp_mat_overlay = CreateClientConVar( "pp_mat_overlay", "", false, false )
+local pp_mat_overlay = CreateClientConVar( "pp_mat_overlay", "", false, false )
local pp_mat_overlay_refractamount = CreateClientConVar( "pp_mat_overlay_refractamount", "0.3", true, false )
local lastTexture = nil
@@ -14,8 +14,8 @@ function DrawMaterialOverlay( texture, refractamount )
mat_Overlay = Material( texture )
lastTexture = texture
end
-
- if ( mat_Overlay == nil ) then return end
+
+ if ( mat_Overlay == nil || mat_Overlay:IsError() ) then return end
render.UpdateScreenEffectTexture()
@@ -27,7 +27,7 @@ function DrawMaterialOverlay( texture, refractamount )
render.SetMaterial( mat_Overlay )
render.DrawScreenQuad()
-
+
end
local function DrawInternal()

0 comments on commit c45a14e

Please sign in to comment.