summaryrefslogtreecommitdiff
path: root/src/server
diff options
context:
space:
mode:
authorZack Middleton <zturtleman@gmail.com>2013-02-11 15:49:47 -0600
committerTim Angus <tim@ngus.net>2013-02-16 21:54:31 +0000
commit349e97bc5dc208123d9e48224d3c577723ef58df (patch)
tree32a148dc74e51e6371c78309b6f7135741efb5dc /src/server
parent9b78065a40eded80b4aaf2e3b9e4fb0097093787 (diff)
Unify/cleanup max snapshot entities on client and server
Diffstat (limited to 'src/server')
-rw-r--r--src/server/server.h2
-rw-r--r--src/server/sv_init.c8
-rw-r--r--src/server/sv_snapshot.c1
3 files changed, 5 insertions, 6 deletions
diff --git a/src/server/server.h b/src/server/server.h
index c4c9edd0..06361190 100644
--- a/src/server/server.h
+++ b/src/server/server.h
@@ -237,7 +237,7 @@ typedef struct {
int snapFlagServerBit; // ^= SNAPFLAG_SERVERCOUNT every SV_SpawnServer()
client_t *clients; // [sv_maxclients->integer];
- int numSnapshotEntities; // sv_maxclients->integer*PACKET_BACKUP*MAX_PACKET_ENTITIES
+ int numSnapshotEntities; // sv_maxclients->integer*PACKET_BACKUP*MAX_SNAPSHOT_ENTITIES
int nextSnapshotEntities; // next snapshotEntities to use
entityState_t *snapshotEntities; // [numSnapshotEntities]
int nextHeartbeatTime;
diff --git a/src/server/sv_init.c b/src/server/sv_init.c
index dd5eef51..1f06b7c4 100644
--- a/src/server/sv_init.c
+++ b/src/server/sv_init.c
@@ -302,10 +302,10 @@ static void SV_Startup( void ) {
svs.clients = Z_Malloc (sizeof(client_t) * sv_maxclients->integer );
if ( com_dedicated->integer ) {
- svs.numSnapshotEntities = sv_maxclients->integer * PACKET_BACKUP * 64;
+ svs.numSnapshotEntities = sv_maxclients->integer * PACKET_BACKUP * MAX_SNAPSHOT_ENTITIES;
} else {
// we don't need nearly as many when playing locally
- svs.numSnapshotEntities = sv_maxclients->integer * 4 * 64;
+ svs.numSnapshotEntities = sv_maxclients->integer * 4 * MAX_SNAPSHOT_ENTITIES;
}
svs.initialized = qtrue;
@@ -380,10 +380,10 @@ void SV_ChangeMaxClients( void ) {
// allocate new snapshot entities
if ( com_dedicated->integer ) {
- svs.numSnapshotEntities = sv_maxclients->integer * PACKET_BACKUP * 64;
+ svs.numSnapshotEntities = sv_maxclients->integer * PACKET_BACKUP * MAX_SNAPSHOT_ENTITIES;
} else {
// we don't need nearly as many when playing locally
- svs.numSnapshotEntities = sv_maxclients->integer * 4 * 64;
+ svs.numSnapshotEntities = sv_maxclients->integer * 4 * MAX_SNAPSHOT_ENTITIES;
}
}
diff --git a/src/server/sv_snapshot.c b/src/server/sv_snapshot.c
index a16b6b2c..6babe979 100644
--- a/src/server/sv_snapshot.c
+++ b/src/server/sv_snapshot.c
@@ -236,7 +236,6 @@ Build a client snapshot structure
=============================================================================
*/
-#define MAX_SNAPSHOT_ENTITIES 1024
typedef struct {
int numSnapshotEntities;
int snapshotEntities[MAX_SNAPSHOT_ENTITIES];