cvar_t sv_gameplayfix_stepwhilejumping = {0, "sv_gameplayfix_stepwhilejumping", "1"};
cvar_t sv_gameplayfix_swiminbmodels = {0, "sv_gameplayfix_swiminbmodels", "1"};
cvar_t sv_gameplayfix_setmodelrealbox = {0, "sv_gameplayfix_setmodelrealbox", "1"};
+cvar_t sv_gameplayfix_blowupfallenzombies = {0, "sv_gameplayfix_blowupfallenzombies", "1"};
+cvar_t sv_gameplayfix_findradiusdistancetobox = {0, "sv_gameplayfix_findradiusdistancetobox", "1"};
cvar_t sv_progs = {0, "sv_progs", "progs.dat" };
server_t sv;
server_static_t svs;
-mempool_t *sv_edicts_mempool = NULL;
+mempool_t *sv_mempool = NULL;
//============================================================================
Cvar_RegisterVariable (&sv_gameplayfix_stepwhilejumping);
Cvar_RegisterVariable (&sv_gameplayfix_swiminbmodels);
Cvar_RegisterVariable (&sv_gameplayfix_setmodelrealbox);
+ Cvar_RegisterVariable (&sv_gameplayfix_blowupfallenzombies);
+ Cvar_RegisterVariable (&sv_gameplayfix_findradiusdistancetobox);
Cvar_RegisterVariable (&sv_protocolname);
Cvar_RegisterVariable (&sv_ratelimitlocalplayer);
Cvar_RegisterVariable (&sv_maxrate);
SV_Phys_Init();
SV_World_Init();
- sv_edicts_mempool = Mem_AllocPool("server edicts", 0, NULL);
+ sv_mempool = Mem_AllocPool("server", 0, NULL);
}
static void SV_SaveEntFile_f(void)
==================
*/
-void SV_StartSound (edict_t *entity, int channel, char *sample, int volume, float attenuation)
+void SV_StartSound (edict_t *entity, int channel, const char *sample, int volume, float attenuation)
{
int sound_num, field_mask, i, ent;
EntityFrame5_FreeDatabase(client->entitydatabase5);
if (sv.protocol == PROTOCOL_DARKPLACES1 || sv.protocol == PROTOCOL_DARKPLACES2 || sv.protocol == PROTOCOL_DARKPLACES3)
- client->entitydatabase = EntityFrame_AllocDatabase(sv_clients_mempool);
+ client->entitydatabase = EntityFrame_AllocDatabase(sv_mempool);
if (sv.protocol == PROTOCOL_DARKPLACES4)
- client->entitydatabase4 = EntityFrame4_AllocDatabase(sv_clients_mempool);
+ client->entitydatabase4 = EntityFrame4_AllocDatabase(sv_mempool);
if (sv.protocol == PROTOCOL_DARKPLACES5 || sv.protocol == PROTOCOL_DARKPLACES6)
- client->entitydatabase5 = EntityFrame5_AllocDatabase(sv_clients_mempool);
+ client->entitydatabase5 = EntityFrame5_AllocDatabase(sv_mempool);
MSG_WriteByte (&client->message, svc_print);
dpsnprintf (message, sizeof (message), "\002\nServer: %s build %s (progs %i crc)", gamename, buildstring, pr_crc);
VectorCopy(ent->v->origin, cs.origin);
VectorCopy(ent->v->angles, cs.angles);
cs.flags = 0;
- cs.effects = (int)ent->v->effects;
- cs.colormap = (qbyte)ent->v->colormap;
- cs.skin = (qbyte)ent->v->skin;
- cs.frame = (qbyte)ent->v->frame;
+ cs.effects = (unsigned)ent->v->effects;
+ cs.colormap = (unsigned)ent->v->colormap;
+ cs.skin = (unsigned)ent->v->skin;
+ cs.frame = (unsigned)ent->v->frame;
cs.viewmodelforclient = GETEDICTFIELDVALUE(ent, eval_viewmodelforclient)->edict;
cs.exteriormodelforclient = GETEDICTFIELDVALUE(ent, eval_exteriormodeltoclient)->edict;
cs.nodrawtoclient = GETEDICTFIELDVALUE(ent, eval_nodrawtoclient)->edict;
sententities[s->number] = sententitiesmark;
}
-entity_state_t sendstates[MAX_EDICTS];
+entity_state_t sendstates[MAX_EDICTS];
void SV_WriteEntitiesToClient(client_t *client, edict_t *clent, sizebuf_t *msg, int *stats)
{
int i, j;
client_t *client;
eval_t *val;
- char *name;
- char *model;
- char *skin;
+ const char *name;
+ const char *model;
+ const char *skin;
// check for changes to be sent over the reliable streams
for (i = 0, host_client = svs.clients;i < svs.maxclients;i++, host_client++)
name = "";
// always point the string back at host_client->name to keep it safe
strlcpy (host_client->name, name, sizeof (host_client->name));
- host_client->edict->v->netname = PR_SetString(host_client->name);
+ host_client->edict->v->netname = PR_SetEngineString(host_client->name);
if (strcmp(host_client->old_name, host_client->name))
{
if (host_client->spawned)
model = "";
// always point the string back at host_client->name to keep it safe
strlcpy (host_client->playermodel, model, sizeof (host_client->playermodel));
- GETEDICTFIELDVALUE(host_client->edict, eval_playermodel)->string = PR_SetString(host_client->playermodel);
+ GETEDICTFIELDVALUE(host_client->edict, eval_playermodel)->string = PR_SetEngineString(host_client->playermodel);
}
// NEXUIZ_PLAYERSKIN
skin = "";
// always point the string back at host_client->name to keep it safe
strlcpy (host_client->playerskin, skin, sizeof (host_client->playerskin));
- GETEDICTFIELDVALUE(host_client->edict, eval_playerskin)->string = PR_SetString(host_client->playerskin);
+ GETEDICTFIELDVALUE(host_client->edict, eval_playerskin)->string = PR_SetEngineString(host_client->playerskin);
}
// frags
================
*/
-int SV_ModelIndex(char *s, int precachemode)
+int SV_ModelIndex(const char *s, int precachemode)
{
int i, limit = (sv.protocol == PROTOCOL_QUAKE ? 256 : MAX_MODELS);
char filename[MAX_QPATH];
================
*/
-int SV_SoundIndex(char *s, int precachemode)
+int SV_SoundIndex(const char *s, int precachemode)
{
int i, limit = (sv.protocol == PROTOCOL_QUAKE ? 256 : MAX_SOUNDS);
char filename[MAX_QPATH];
SV_ClearWorld();
sv.max_edicts = min(sv.max_edicts + 256, MAX_EDICTS);
- sv.edictsengineprivate = Mem_Alloc(sv_edicts_mempool, sv.max_edicts * sizeof(edict_engineprivate_t));
- sv.edictsfields = Mem_Alloc(sv_edicts_mempool, sv.max_edicts * pr_edict_size);
- sv.moved_edicts = Mem_Alloc(sv_edicts_mempool, sv.max_edicts * sizeof(edict_t *));
+ sv.edictsengineprivate = PR_Alloc(sv.max_edicts * sizeof(edict_engineprivate_t));
+ sv.edictsfields = PR_Alloc(sv.max_edicts * pr_edict_size);
+ sv.moved_edicts = PR_Alloc(sv.max_edicts * sizeof(edict_t *));
memcpy(sv.edictsengineprivate, oldedictsengineprivate, oldmax_edicts * sizeof(edict_engineprivate_t));
memcpy(sv.edictsfields, oldedictsfields, oldmax_edicts * pr_edict_size);
SV_LinkEdict(ent, false);
}
- Mem_Free(oldedictsengineprivate);
- Mem_Free(oldedictsfields);
- Mem_Free(oldmoved_edicts);
+ PR_Free(oldedictsengineprivate);
+ PR_Free(oldedictsfields);
+ PR_Free(oldmoved_edicts);
}
/*
sv.max_edicts = max(svs.maxclients + 1, 512);
sv.max_edicts = min(sv.max_edicts, MAX_EDICTS);
- // clear the edict memory pool
- Mem_EmptyPool(sv_edicts_mempool);
// edict_t structures (hidden from progs)
- sv.edicts = Mem_Alloc(sv_edicts_mempool, MAX_EDICTS * sizeof(edict_t));
+ sv.edicts = PR_Alloc(MAX_EDICTS * sizeof(edict_t));
// engine private structures (hidden from progs)
- sv.edictsengineprivate = Mem_Alloc(sv_edicts_mempool, sv.max_edicts * sizeof(edict_engineprivate_t));
+ sv.edictsengineprivate = PR_Alloc(sv.max_edicts * sizeof(edict_engineprivate_t));
// progs fields, often accessed by server
- sv.edictsfields = Mem_Alloc(sv_edicts_mempool, sv.max_edicts * pr_edict_size);
+ sv.edictsfields = PR_Alloc(sv.max_edicts * pr_edict_size);
// used by PushMove to move back pushed entities
- sv.moved_edicts = Mem_Alloc(sv_edicts_mempool, sv.max_edicts * sizeof(edict_t *));
+ sv.moved_edicts = PR_Alloc(sv.max_edicts * sizeof(edict_t *));
for (i = 0;i < sv.max_edicts;i++)
{
ent = sv.edicts + i;
ent = EDICT_NUM(0);
memset (ent->v, 0, progs->entityfields * 4);
ent->e->free = false;
- ent->v->model = PR_SetString(sv.modelname);
+ ent->v->model = PR_SetEngineString(sv.modelname);
ent->v->modelindex = 1; // world model
ent->v->solid = SOLID_BSP;
ent->v->movetype = MOVETYPE_PUSH;
else
pr_global_struct->deathmatch = deathmatch.integer;
- pr_global_struct->mapname = PR_SetString(sv.name);
+ pr_global_struct->mapname = PR_SetEngineString(sv.name);
// serverflags are for cross level information (sigils)
pr_global_struct->serverflags = svs.serverflags;