mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2025-02-13 23:40:58 +00:00
finally nailed the SubdividePolygon() segfault when running as a dedicated
server: R_Init() isn't called for dedicated server therefore gl_subdivide_size was used without being registered hence divisions by zero when using its value member. Geez.. Moved its registration to Mod_Init() and we are good. git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@565 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
parent
96d60a3f51
commit
7a58f5033c
3 changed files with 5 additions and 12 deletions
|
@ -52,6 +52,7 @@ Mod_Init
|
|||
*/
|
||||
void Mod_Init (void)
|
||||
{
|
||||
Cvar_RegisterVariable (&gl_subdivide_size, NULL);
|
||||
Cvar_RegisterVariable (&external_ents, NULL);
|
||||
|
||||
memset (mod_novis, 0xff, sizeof(mod_novis));
|
||||
|
@ -1088,12 +1089,7 @@ void Mod_LoadFaces (lump_t *l)
|
|||
{
|
||||
out->flags |= (SURF_DRAWTURB | SURF_DRAWTILED);
|
||||
Mod_PolyForUnlitSurface (out);
|
||||
/* FIXME:
|
||||
With dedicated servers, we segfault in SubdividePolygon() at
|
||||
the BoundPoly() call. The following dedicated server check is
|
||||
a workaround, the actual problem is yet to be looked into. */
|
||||
if (cls.state != ca_dedicated)
|
||||
GL_SubdivideSurface (out);
|
||||
GL_SubdivideSurface (out);
|
||||
}
|
||||
else if (out->texinfo->flags & TEX_MISSING) // texture is missing from bsp
|
||||
{
|
||||
|
|
|
@ -47,10 +47,6 @@ extern cvar_t r_nolerp_list;
|
|||
|
||||
extern cvar_t gl_zfix; // QuakeSpasm z-fighting fix
|
||||
|
||||
extern float load_subdivide_size; //johnfitz -- remember what subdivide_size value was when this map was loaded
|
||||
|
||||
extern cvar_t gl_subdivide_size; //johnfitz -- moved here from gl_model.c
|
||||
|
||||
extern gltexture_t *playertextures[MAX_SCOREBOARD]; //johnfitz
|
||||
|
||||
|
||||
|
@ -244,8 +240,6 @@ void R_Init (void)
|
|||
|
||||
Cvar_RegisterVariable (&gl_zfix, NULL); // QuakeSpasm z-fighting fix
|
||||
|
||||
Cvar_RegisterVariable (&gl_subdivide_size, NULL); //johnfitz -- moved here from gl_model.c
|
||||
|
||||
R_InitParticles ();
|
||||
R_SetClearColor_f (&r_clearcolor); //johnfitz
|
||||
|
||||
|
|
|
@ -158,6 +158,9 @@ extern cvar_t gl_nocolors;
|
|||
extern cvar_t gl_max_size;
|
||||
extern cvar_t gl_playermip;
|
||||
|
||||
extern cvar_t gl_subdivide_size;
|
||||
extern float load_subdivide_size; //johnfitz -- remember what subdivide_size value was when this map was loaded
|
||||
|
||||
extern float r_world_matrix[16];
|
||||
|
||||
extern const char *gl_vendor;
|
||||
|
|
Loading…
Reference in a new issue