Code:
int NUM_FOR_EDICT(edict_t *e)
{
int b;
b = (byte *)e - (byte *)sv.edicts;
b = b / pr_edict_size;
if (b < 0 || b >= sv.num_edicts)
SV_Error ("NUM_FOR_EDICT: bad pointer");
return b;
}
Looks like the error is made when the entity index is below zero or greater than the amount of entities in the game.