Facepunch / garrysmod-issues

Garry's Mod issue tracker
144 stars 56 forks source link

Meshes crash or cause graphical glitches when a function errors #2594

Open Bo98 opened 8 years ago

Bo98 commented 8 years ago

Example:

mesh.Begin(MATERIAL_LINES, 1)
    -- Error
    mesh.Position(0, 0)
    mesh.AdvanceVertex()

    -- Should be:
    mesh.Position(Vector(1, 1))
    mesh.AdvanceVertex()
mesh.End()

Maybe abandon the mesh operation instead of leaving it in the state it is? I'm not sure what would work.

Graphical glitches occur on Windows (and can only be fixed with a restart), crash occurs on OS X.

thegrb93 commented 8 years ago

Same happens for many other graphical begin/end systems so I think you're intended to handle the errors rather than let them throw your script without finishing the graphics operation. It's also probably impossible to change this behavior without adding overhead to other graphics code.