]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
Do not build VBOs on a dedicated server.
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 19 Oct 2018 07:38:00 +0000 (07:38 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 19 Oct 2018 07:38:00 +0000 (07:38 +0000)
Fixes crash at startup of dedicated server in Quake and Xonotic
(probably in everything).

The only reason why this ever worked before was that Mod_BuildVBOs's
main callee R_Mesh_CreateMeshBuffer did a GL2 feature test before
calling into anything VBO related (and on a dedicated server, which does
not initialize GL, the test always returns false); however now that we
require GL32, the feature test is gone and thus the crash happened. An
explicit check for being a dedicated server fixes that.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12469 d7cf8633-e32d-0410-b094-e92efae38249

model_shared.c

index 48b4315ba67c3a96053c105868db7c0841d48343..a6d97670fcb9d864de9e49b1b3cac0de4a0976ad 100644 (file)
@@ -2893,6 +2893,9 @@ void Mod_MakeSortedSurfaces(dp_model_t *mod)
 
 void Mod_BuildVBOs(void)
 {
+       if(cls.state == ca_dedicated)
+               return;
+
        if (!loadmodel->surfmesh.num_vertices)
                return;