mirror of
https://github.com/Earu/EasyChat.git
synced 2025-03-04 03:13:20 -05:00
fix an error that would happen if no argument is passed to the texture tag
This commit is contained in:
parent
ac587ec18f
commit
9779316148
@ -505,6 +505,12 @@ function texture_part:Ctor(str)
|
|||||||
|
|
||||||
local path = texture_components[1]:Trim()
|
local path = texture_components[1]:Trim()
|
||||||
local mat = Material(path, path:EndsWith(".png") and "nocull noclamp" or nil)
|
local mat = Material(path, path:EndsWith(".png") and "nocull noclamp" or nil)
|
||||||
|
if not mat then
|
||||||
|
self.Invalid = true
|
||||||
|
self.TextureSize = math.Clamp(tonumber(texture_components[2]) or draw.GetFontHeight(self.HUD.DefaultFont), 16, 64)
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
local shader = mat:GetShader()
|
local shader = mat:GetShader()
|
||||||
if shader == "VertexLitGeneric" or shader == "Cable" then
|
if shader == "VertexLitGeneric" or shader == "Cable" then
|
||||||
local tex_path = mat:GetString("$basetexture")
|
local tex_path = mat:GetString("$basetexture")
|
||||||
|
Loading…
Reference in New Issue
Block a user