cvar_t sv_gameplayfix_swiminbmodels = {0, "sv_gameplayfix_swiminbmodels", "1"};
cvar_t sv_gameplayfix_setmodelrealbox = {0, "sv_gameplayfix_setmodelrealbox", "1"};
+cvar_t sv_progs = {0, "sv_progs", "progs.dat" };
+
server_t sv;
server_static_t svs;
Cvar_RegisterVariable (&sv_protocolname);
Cvar_RegisterVariable (&sv_ratelimitlocalplayer);
Cvar_RegisterVariable (&sv_maxrate);
+ Cvar_RegisterVariable (&sv_progs);
SV_Phys_Init();
SV_World_Init();
client->entitydatabase5 = EntityFrame5_AllocDatabase(sv_clients_mempool);
MSG_WriteByte (&client->message, svc_print);
- snprintf (message, sizeof (message), "\002\nServer: %s build %s (progs %i crc)", gamename, buildstring, pr_crc);
+ dpsnprintf (message, sizeof (message), "\002\nServer: %s build %s (progs %i crc)", gamename, buildstring, pr_crc);
MSG_WriteString (&client->message,message);
MSG_WriteByte (&client->message, svc_serverinfo);
int e, i;
float f;
edict_t *ent;
+ eval_t *val;
entity_state_t cs;
// send all entities that touch the pvs
numsendentities = 0;
if (GETEDICTFIELDVALUE(ent, eval_glow_trail)->_float)
cs.flags |= RENDER_GLOWTRAIL;
+ // don't need to init cs.colormod because the defaultstate did that for us
+ //cs.colormod[0] = cs.colormod[1] = cs.colormod[2] = 32;
+ val = GETEDICTFIELDVALUE(ent, eval_colormod);
+ if (val->vector[0] || val->vector[1] || val->vector[2])
+ {
+ i = val->vector[0] * 32.0f;cs.colormod[0] = bound(0, i, 255);
+ i = val->vector[1] * 32.0f;cs.colormod[1] = bound(0, i, 255);
+ i = val->vector[2] * 32.0f;cs.colormod[2] = bound(0, i, 255);
+ }
+
cs.modelindex = 0;
i = (int)ent->v->modelindex;
if (i >= 1 && i < MAX_MODELS && *PR_GetString(ent->v->model))
Con_Printf("SV_ModelIndex(\"%s\"): not precached (fix your code), precaching anyway\n", filename);
strlcpy(sv.model_precache[i], filename, sizeof(sv.model_precache[i]));
sv.models[i] = Mod_ForName (sv.model_precache[i], true, false, false);
- if (sv.protocol == PROTOCOL_DARKPLACES6)
+ if (sv.protocol == PROTOCOL_DARKPLACES6 && sv.state != ss_loading)
{
MSG_WriteByte(&sv.reliable_datagram, svc_precache);
MSG_WriteShort(&sv.reliable_datagram, i);
if (precachemode == 1)
Con_Printf("SV_SoundIndex(\"%s\"): not precached (fix your code), precaching anyway\n", filename);
strlcpy(sv.sound_precache[i], filename, sizeof(sv.sound_precache[i]));
- if (sv.protocol == PROTOCOL_DARKPLACES6)
+ if (sv.protocol == PROTOCOL_DARKPLACES6 && sv.state != ss_loading)
{
MSG_WriteByte(&sv.reliable_datagram, svc_precache);
MSG_WriteShort(&sv.reliable_datagram, i + 32768);
Con_DPrintf("SpawnServer: %s\n", server);
- snprintf (modelname, sizeof(modelname), "maps/%s.bsp", server);
+ if (cls.state != ca_dedicated)
+ SCR_BeginLoadingPlaque();
+
+ dpsnprintf (modelname, sizeof(modelname), "maps/%s.bsp", server);
worldmodel = Mod_ForName(modelname, false, true, true);
if (!worldmodel || !worldmodel->TraceBox)
{
//
if (coop.integer)
Cvar_SetValue ("deathmatch", 0);
- current_skill = bound(0, (int)(skill.value + 0.5), 3);
-
- Cvar_SetValue ("skill", (float)current_skill);
+ // LordHavoc: it can be useful to have skills outside the range 0-3...
+ //current_skill = bound(0, (int)(skill.value + 0.5), 3);
+ //Cvar_SetValue ("skill", (float)current_skill);
+ current_skill = (int)(skill.value + 0.5);
//
// set up the new server
}
// load progs to get entity field count
- PR_LoadProgs ();
+ PR_LoadProgs ( sv_progs.string );
// allocate server memory
// start out with just enough room for clients and a reasonable estimate of entities
strlcpy(sv.model_precache[1], sv.modelname, sizeof(sv.model_precache[1]));
for (i = 1;i < sv.worldmodel->brush.numsubmodels;i++)
{
- snprintf(sv.model_precache[i+1], sizeof(sv.model_precache[i+1]), "*%i", i);
+ dpsnprintf(sv.model_precache[i+1], sizeof(sv.model_precache[i+1]), "*%i", i);
sv.models[i+1] = Mod_ForName (sv.model_precache[i+1], false, false, false);
}