Make kamikaze timer loops use level.num_entities instead of MAX_GENTITIES

Optimization. Many other loops use level.num_entities, there was no
special reason that MAX_GENTITIES was used for these.
This commit is contained in:
Zack Middleton 2013-11-21 02:19:15 -06:00
parent 57eae5da91
commit 1633ac5b93
2 changed files with 2 additions and 2 deletions

View file

@ -426,7 +426,7 @@ void CopyToBodyQue( gentity_t *ent ) {
body->s.eFlags |= EF_KAMIKAZE; body->s.eFlags |= EF_KAMIKAZE;
// check if there is a kamikaze timer around for this owner // check if there is a kamikaze timer around for this owner
for (i = 0; i < MAX_GENTITIES; i++) { for (i = 0; i < level.num_entities; i++) {
e = &g_entities[i]; e = &g_entities[i];
if (!e->inuse) if (!e->inuse)
continue; continue;

View file

@ -241,7 +241,7 @@ void GibEntity( gentity_t *self, int killer ) {
//if this entity still has kamikaze //if this entity still has kamikaze
if (self->s.eFlags & EF_KAMIKAZE) { if (self->s.eFlags & EF_KAMIKAZE) {
// check if there is a kamikaze timer around for this owner // check if there is a kamikaze timer around for this owner
for (i = 0; i < MAX_GENTITIES; i++) { for (i = 0; i < level.num_entities; i++) {
ent = &g_entities[i]; ent = &g_entities[i];
if (!ent->inuse) if (!ent->inuse)
continue; continue;