X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=sv_main.c;h=4b4ac374400738b63d6d222b0c2a3edf649497b6;hb=1b26cea514d09f4d545e823db4317ac351b8605c;hp=4bd029285034556163168a49ce7ec4b6a1747ea7;hpb=1e1dbc1c5b89ae4ab8cdd9b32dc6413c67f5dd84;p=xonotic%2Fdarkplaces.git diff --git a/sv_main.c b/sv_main.c index 4bd02928..4b4ac374 100644 --- a/sv_main.c +++ b/sv_main.c @@ -26,6 +26,11 @@ static cvar_t sv_cullentities_trace = {0, "sv_cullentities_trace", "0"}; // tend static cvar_t sv_cullentities_stats = {0, "sv_cullentities_stats", "0"}; static cvar_t sv_entpatch = {0, "sv_entpatch", "1"}; +cvar_t sv_gameplayfix_grenadebouncedownslopes = {0, "sv_gameplayfix_grenadebouncedownslopes", "1"}; +cvar_t sv_gameplayfix_noairborncorpse = {0, "sv_gameplayfix_noairborncorpse", "1"}; +cvar_t sv_gameplayfix_stepwhilejumping = {0, "sv_gameplayfix_stepwhilejumping", "1"}; +cvar_t sv_gameplayfix_swiminbmodels = {0, "sv_gameplayfix_swiminbmodels", "1"}; + server_t sv; server_static_t svs; @@ -64,6 +69,10 @@ void SV_Init (void) Cvar_RegisterVariable (&sv_cullentities_trace); Cvar_RegisterVariable (&sv_cullentities_stats); Cvar_RegisterVariable (&sv_entpatch); + Cvar_RegisterVariable (&sv_gameplayfix_grenadebouncedownslopes); + Cvar_RegisterVariable (&sv_gameplayfix_noairborncorpse); + Cvar_RegisterVariable (&sv_gameplayfix_stepwhilejumping); + Cvar_RegisterVariable (&sv_gameplayfix_swiminbmodels); SV_Phys_Init(); SV_World_Init(); @@ -959,9 +968,9 @@ void SV_MarkWriteEntityStateToClient(entity_state_t *s) lightmins[0] = min(entmins[0], s->origin[0] - s->specialvisibilityradius); lightmins[1] = min(entmins[1], s->origin[1] - s->specialvisibilityradius); lightmins[2] = min(entmins[2], s->origin[2] - s->specialvisibilityradius); - lightmaxs[0] = min(entmaxs[0], s->origin[0] + s->specialvisibilityradius); - lightmaxs[1] = min(entmaxs[1], s->origin[1] + s->specialvisibilityradius); - lightmaxs[2] = min(entmaxs[2], s->origin[2] + s->specialvisibilityradius); + lightmaxs[0] = max(entmaxs[0], s->origin[0] + s->specialvisibilityradius); + lightmaxs[1] = max(entmaxs[1], s->origin[1] + s->specialvisibilityradius); + lightmaxs[2] = max(entmaxs[2], s->origin[2] + s->specialvisibilityradius); sv_writeentitiestoclient_totalentities++; // if not touching a visible leaf if (sv_cullentities_pvs.integer && sv_writeentitiestoclient_pvsbytes && sv.worldmodel && sv.worldmodel->brush.BoxTouchingPVS && !sv.worldmodel->brush.BoxTouchingPVS(sv.worldmodel, sv_writeentitiestoclient_pvs, lightmins, lightmaxs)) @@ -1090,7 +1099,7 @@ void SV_WriteEntitiesToClient(client_t *client, edict_t *clent, sizebuf_t *msg) MSG_WriteLong(msg, d->currentcommit->framenum); if (developer_networkentities.integer >= 1) { - Con_Printf("send svc_entities ref:%i num:%i (database: ref:%i commits:", d->referenceframenum, d->currentcommit->framenum, d->referenceframenum); + Con_Printf("send svc_entities num:%i ref:%i (database: ref:%i commits:", d->currentcommit->framenum, d->referenceframenum, d->referenceframenum); for (i = 0;i < MAX_ENTITY_HISTORY;i++) if (d->commit[i].numentities) Con_Printf(" %i", d->commit[i].framenum); @@ -1791,13 +1800,24 @@ void SV_SpawnServer (const char *server) edict_t *ent; int i; qbyte *entities; + model_t *worldmodel; + char modelname[sizeof(sv.modelname)]; + + Con_DPrintf("SpawnServer: %s\n", server); + + snprintf (modelname, sizeof(modelname), "maps/%s.bsp", server); + worldmodel = Mod_ForName(modelname, false, true, true); + if (!worldmodel || !worldmodel->TraceBox) + { + Con_Printf("Couldn't load map %s\n", modelname); + return; + } // let's not have any servers with no name if (hostname.string[0] == 0) Cvar_Set ("hostname", "UNNAMED"); scr_centertime_off = 0; - Con_DPrintf("SpawnServer: %s\n",server); svs.changelevel_issued = false; // now safe to issue another // @@ -1876,16 +1896,11 @@ void SV_SpawnServer (const char *server) sv.time = 1.0; Mod_ClearUsed(); + worldmodel->used = true; strlcpy (sv.name, server, sizeof (sv.name)); - snprintf (sv.modelname, sizeof (sv.modelname), "maps/%s.bsp", server); - sv.worldmodel = Mod_ForName(sv.modelname, false, true, true); - if (!sv.worldmodel) - { - Con_Printf("Couldn't spawn server %s\n", sv.modelname); - sv.active = false; - return; - } + strcpy(sv.modelname, modelname); + sv.worldmodel = worldmodel; sv.models[1] = sv.worldmodel; //