Properly check if the number of tris is sufficient for tessellation
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 18s

This commit is contained in:
smallmodel 2025-01-15 21:38:49 +01:00 committed by GitHub
parent 94aaeac194
commit ab80045329
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -998,7 +998,9 @@ static void R_DoTriSplitting()
//
// make sure there are sufficient number of tris
//
if (g_tri.nFree < 14 || g_vert.nFree < 14) {
// Fixed in OPM
// Properly check the number of tris, which is double the number of verts
if (g_tri.nFree < 14*2 || g_vert.nFree < 14) {
ri.Printf(PRINT_DEVELOPER, "WARNING: aborting terrain tessellation -- insufficient tris\n");
return;
}