diff --git a/src/client/cl_effects.c b/src/client/cl_effects.c index dc3c7d94..f08ec132 100644 --- a/src/client/cl_effects.c +++ b/src/client/cl_effects.c @@ -54,7 +54,8 @@ CL_AddMuzzleFlash(void) if ((i < 1) || (i >= MAX_EDICTS)) { - Com_Error(ERR_DROP, "CL_AddMuzzleFlash: bad entity"); + Com_Error(ERR_DROP, "%s: bad entity %d >= %d\n", + __func__, i, MAX_EDICTS); } weapon = MSG_ReadByte(&net_message); @@ -334,14 +335,15 @@ CL_AddMuzzleFlash2(void) if ((ent < 1) || (ent >= MAX_EDICTS)) { - Com_Error(ERR_DROP, "CL_AddMuzzleFlash2: bad entity"); + Com_Error(ERR_DROP, "%s: bad entity %d >= %d\n", + __func__, ent, MAX_EDICTS); } flash_number = MSG_ReadByte(&net_message); if (flash_number > 210) { - Com_DPrintf("CL_AddMuzzleFlash2: bad offset"); + Com_DPrintf("%s: bad offset\n", __func__); return; } diff --git a/src/client/cl_entities.c b/src/client/cl_entities.c index af967f74..fd806c9b 100644 --- a/src/client/cl_entities.c +++ b/src/client/cl_entities.c @@ -864,7 +864,8 @@ CL_GetEntitySoundOrigin(int ent, vec3_t org) if ((ent < 0) || (ent >= MAX_EDICTS)) { - Com_Error(ERR_DROP, "CL_GetEntitySoundOrigin: bad ent"); + Com_Error(ERR_DROP, "%s: bad entity %d >= %d\n", + __func__, ent, MAX_EDICTS); } old = &cl_entities[ent]; @@ -881,7 +882,8 @@ CL_GetEntitySoundVelocity(int ent, vec3_t vel) if ((ent < 0) || (ent >= MAX_EDICTS)) { - Com_Error(ERR_DROP, "CL_GetEntitySoundVelocity: bad ent"); + Com_Error(ERR_DROP, "%s: bad entity %d >= %d\n", + __func__, ent, MAX_EDICTS); } old = &cl_entities[ent]; diff --git a/src/client/cl_parse.c b/src/client/cl_parse.c index 57993d57..aeff4ddc 100644 --- a/src/client/cl_parse.c +++ b/src/client/cl_parse.c @@ -380,12 +380,13 @@ CL_ParsePacketEntities(frame_t *oldframe, frame_t *newframe) if (newnum >= MAX_EDICTS) { - Com_Error(ERR_DROP, "CL_ParsePacketEntities: bad number:%i", newnum); + Com_Error(ERR_DROP, "%s: bad entity %d >= %d\n", + __func__, newnum, MAX_EDICTS); } if (net_message.readcount > net_message.cursize) { - Com_Error(ERR_DROP, "CL_ParsePacketEntities: end of message"); + Com_Error(ERR_DROP, "%s: end of message", __func__); } if (!newnum) @@ -1192,7 +1193,8 @@ CL_ParseStartSoundPacket(void) if (ent > MAX_EDICTS) { - Com_Error(ERR_DROP, "CL_ParseStartSoundPacket: ent = %i", ent); + Com_Error(ERR_DROP, "%s: bad entity %d >= %d\n", + __func__, ent, MAX_EDICTS); } channel &= 7; diff --git a/src/common/movemsg.c b/src/common/movemsg.c index 567f0996..be9b656d 100644 --- a/src/common/movemsg.c +++ b/src/common/movemsg.c @@ -444,7 +444,8 @@ MSG_WriteDeltaEntity(entity_state_t *from, if (to->number >= MAX_EDICTS) { - Com_Error(ERR_FATAL, "Entity number >= MAX_EDICTS"); + Com_Error(ERR_DROP, "%s: bad entity %d >= %d\n", + __func__, to->number, MAX_EDICTS); } /* send an update */ diff --git a/src/server/sv_init.c b/src/server/sv_init.c index 7d2a161a..3ba3a55c 100644 --- a/src/server/sv_init.c +++ b/src/server/sv_init.c @@ -122,6 +122,11 @@ SV_CreateBaseline(void) /* take current state as baseline */ VectorCopy(svent->s.origin, svent->s.old_origin); + if (entnum >= MAX_EDICTS) + { + Com_Error(ERR_DROP, "%s: bad entity %d >= %d\n", + __func__, entnum, MAX_EDICTS); + } sv.baselines[entnum] = svent->s; } }