From 0bb01f310f18216e9d0834d81d0fffc1b98d04f1 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Mon, 10 Dec 2001 03:17:21 +0000 Subject: [PATCH] don't crash when there are too many entities for update messages. just ignore the excess. --- qw/source/sv_ents.c | 6 ++++-- tools/qwaq/main.qc | 8 ++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/qw/source/sv_ents.c b/qw/source/sv_ents.c index fc3b2c0a0..ea1490f91 100644 --- a/qw/source/sv_ents.c +++ b/qw/source/sv_ents.c @@ -488,7 +488,7 @@ void SV_WriteEntitiesToClient (client_t *client, sizebuf_t *msg) { byte *pvs; - int e, i; + int e, i, num_edicts; vec3_t org; client_frame_t *frame; edict_t *clent, *ent; @@ -513,8 +513,10 @@ SV_WriteEntitiesToClient (client_t *client, sizebuf_t *msg) numnails = 0; + num_edicts = min (sv.num_edicts, 512); //FIXME stupid protocol limit + for (e = MAX_CLIENTS + 1, ent = EDICT_NUM (&sv_pr_state, e); - e < sv.num_edicts; + e < num_edicts; e++, ent = NEXT_EDICT (&sv_pr_state, ent)) { if (ent->free) continue; diff --git a/tools/qwaq/main.qc b/tools/qwaq/main.qc index 9e4ba3f0f..3abd0b94b 100644 --- a/tools/qwaq/main.qc +++ b/tools/qwaq/main.qc @@ -3,7 +3,12 @@ #define NIT_TELEPORTER 131072 //CH Teleporter #define PC_ENGINEER_TF_ITEMS NIT_TESLA | NIT_SECURITY_CAMERA | NIT_TELEPORTER -void () eek; +struct foo = { + integer result; + string buffer; +}; + +void (foo bar) eek; float (float a, float b) boing; float () main = @@ -12,7 +17,6 @@ float () main = local integer handle; local string buffer; - traceon(); messed_or = PC_ENGINEER_TF_ITEMS; handle = open ("main.qc", 0); if (handle == -1) {