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_stepdown = {0, "sv_gameplayfix_stepdown", "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;
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_stepdown);
+ Cvar_RegisterVariable (&sv_gameplayfix_stepwhilejumping);
+ Cvar_RegisterVariable (&sv_gameplayfix_swiminbmodels);
SV_Phys_Init();
SV_World_Init();
for (i = 0;i < MAX_MODELS;i++)
sprintf (localmodels[i], "*%i", i);
- sv_edicts_mempool = Mem_AllocPool("server edicts");
+ sv_edicts_mempool = Mem_AllocPool("server edicts", 0, NULL);
}
static void SV_SaveEntFile_f(void)
char basename[MAX_QPATH];
if (!sv.active || !sv.worldmodel)
{
- Con_Printf("Not running a server\n");
+ Con_Print("Not running a server\n");
return;
}
FS_StripExtension(sv.worldmodel->name, basename, sizeof(basename));
if ( sound_num == MAX_SOUNDS || !sv.sound_precache[sound_num] )
{
- Con_Printf ("SV_StartSound: %s not precached\n", sample);
+ Con_Printf("SV_StartSound: %s not precached\n", sample);
return;
}
if (msg->maxsize - msg->cursize < 32) // LordHavoc: increased check from 16 to 32
{
- Con_Printf ("packet overflow\n");
+ Con_Print("packet overflow\n");
// mark the rest of the entities so they can't be delta compressed against this frame
for (;e < sv.num_edicts;e++)
{
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))
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);
- Con_Printf(")\n");
+ Con_Print(")\n");
}
if (d->currententitynumber >= sv.max_edicts)
startnumber = 1;
if (s->exteriormodelforclient && s->exteriormodelforclient == sv_writeentitiestoclient_clentnum)
{
s->flags |= RENDER_EXTERIORMODEL;
- EntityState_Write(s, &buf, e);
+ EntityState_WriteUpdate(s, &buf, e);
s->flags &= ~RENDER_EXTERIORMODEL;
}
else
- EntityState_Write(s, &buf, e);
+ EntityState_WriteUpdate(s, &buf, e);
}
else
{
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
//
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;
//
// load replacement entity file if found
entities = NULL;
if (sv_entpatch.integer)
- entities = FS_LoadFile(va("maps/%s.ent", sv.name), true);
+ entities = FS_LoadFile(va("maps/%s.ent", sv.name), tempmempool, true);
if (entities)
{
Con_Printf("Loaded maps/%s.ent\n", sv.name);
if (host_client->netconnection)
SV_SendServerinfo(host_client);
- Con_DPrintf ("Server spawned.\n");
+ Con_DPrint("Server spawned.\n");
NetConn_Heartbeat (2);
}