Get entity allocation and freeing working correctly.

This fixes the missing static entities.
This commit is contained in:
Bill Currie 2010-12-04 23:37:58 +09:00
parent 9bce1630a6
commit b1b1a02c6c

View file

@ -84,7 +84,7 @@ R_AllocEntity (void)
for (ent = pool->entities, i = 0; i < ENT_POOL_SIZE - 1; i++, ent++)
ent->next = ent + 1;
ent->next = 0;
free_entities = entity_pools->entities;
free_entities = pool->entities;
return R_AllocEntity ();
}
@ -99,7 +99,7 @@ R_FreeAllEntities (void)
for (pool = entity_pools; pool; pool = pool->next) {
for (ent = pool->entities, i = 0; i < ENT_POOL_SIZE - 1; i++, ent++)
ent->next = ent + 1;
ent->next = pool->next ? pool->entities : 0;
ent->next = pool->next ? pool->next->entities : 0;
}
free_entities = entity_pools ? entity_pools->entities : 0;
}