From 844f9ed2177233f7daa9de47730c4d45780794da Mon Sep 17 00:00:00 2001 From: Nikita Kruglickiy Date: Mon, 20 Sep 2021 00:05:56 +0600 Subject: [PATCH] Catch material.load error --- koptilnya/mesh_loader/cl_builder.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/koptilnya/mesh_loader/cl_builder.txt b/koptilnya/mesh_loader/cl_builder.txt index 34119e6..9326d0d 100644 --- a/koptilnya/mesh_loader/cl_builder.txt +++ b/koptilnya/mesh_loader/cl_builder.txt @@ -62,7 +62,11 @@ function MeshBuilder:initialize(link) if (isURL(mat.basetexture)) then mat = self:_createMaterial(mat.shader, mat.basetexture, mat.bumpmap, mat.options) else - mat = material.load(mat.basetexture) + hasErr, mat = pcall(material.load, mat.basetexture) + + if not hasErr then + mat = material.load("models/debug/debugwhite") + end end local object = {name = name, mat = mat, holo = holo}