mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-03-20 09:21:09 +00:00
Delay the "too many entities" check.
Rather than checking the raw edict count in the entities file against the progs' max_edicts, check the allocated entity's number. This allows loading of sophisticated maps (eg, digs04) that prune many of their entities.
This commit is contained in:
parent
ce16750b04
commit
6e0907a6b1
1 changed files with 5 additions and 2 deletions
|
@ -434,8 +434,6 @@ ED_SpawnEntities (progs_t *pr, plitem_t *entity_list)
|
|||
|
||||
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);
|
||||
|
||||
|
@ -448,6 +446,11 @@ ED_SpawnEntities (progs_t *pr, plitem_t *entity_list)
|
|||
else
|
||||
ent = ED_Alloc (pr);
|
||||
|
||||
// don't allow the last edict to be used, as otherwise we can't detect
|
||||
// too many edicts
|
||||
if (NUM_FOR_EDICT (pr, ent) >= pr->max_edicts - 1)
|
||||
PR_Error (pr, "too many entities: %d > %d", count, max_edicts);
|
||||
|
||||
ED_InitEntity (pr, entity, ent);
|
||||
|
||||
// remove things from different skill levels or deathmatch
|
||||
|
|
Loading…
Reference in a new issue