Register a complaint when the map has too many entities.

I was wondering why that parrot was dead.

Not realizing that negke's coag3 map had too many entities really ruined
the pleasure of playing it, so it's best to treat such situations as an
error (max_edicts can be bumped up to 32000 if need be, but 2048 is plenty
for his map).
This commit is contained in:
Bill Currie 2011-04-17 20:06:20 +09:00
parent 47e55fe1c6
commit 2a2a431431

View file

@ -408,8 +408,12 @@ ED_SpawnEntities (progs_t *pr, plitem_t *entity_list)
int count;
const char *classname;
dfunction_t *func;
pr_int_t max_edicts = pr->pr_edictareasize / pr->pr_edict_size;
max_edicts -= *pr->num_edicts;
count = PL_A_NumObjects (entity_list);
if (count > max_edicts)
PR_Error (pr, "too many entities: %d > %d", count, max_edicts);
for (i = 0; i < count; i++) {
entity = PL_ObjectAtIndex (entity_list, i);