diff --git a/lua/prop2mesh/cl_meshlab.lua b/lua/prop2mesh/cl_meshlab.lua index 04b0caa..250dbc1 100644 --- a/lua/prop2mesh/cl_meshlab.lua +++ b/lua/prop2mesh/cl_meshlab.lua @@ -39,6 +39,7 @@ local coroutine_yield = coroutine.yield local a90 = Angle(0, -90, 0) local YIELD_THRESHOLD = 30 +local devcvar = GetConVar("developer") local cvar = CreateClientConVar("prop2mesh_render_disable_obj", 0, true, false) local disable_obj = cvar:GetBool() @@ -865,7 +866,10 @@ local function getVertsFromOBJ(custom, partnext, meshtex, meshbump, vmins, vmaxs local smooth = partnext.vsmooth local parseErr, errChar, errLine = tryParseObj(modelobj, vmesh, vlook, vmins, vmaxs, pos, ang, scale, invert, meshtex) if parseErr then - ErrorNoHalt("Prop2Mesh getVertsFromOBJ failure at line " .. errLine .. ", char " .. errChar .. ": " .. tostring(parseErr) .. "\n") + if devcvar:GetBool() then + ErrorNoHalt("Prop2Mesh getVertsFromOBJ failure at line " .. errLine .. ", char " .. errChar .. ": " .. tostring(parseErr) .. "\n") + end + coroutine_yield(false) end @@ -1093,7 +1097,10 @@ hook.Add("Think", "prop2mesh_meshlab", function() local ok, err, mdata = coroutine.resume(lab.coro, lab.data, lab.uniqueID) if not ok then - ErrorNoHaltWithStack("Prop2Mesh Meshlab error: " .. (tostring(err) or "")) + if devcvar:GetBool() then + ErrorNoHaltWithStack("Prop2Mesh Meshlab error: " .. (tostring(err) or "")) + end + meshlabs[key] = nil break end