From 1633ac5b9368f4abaa3f758c1c81ccf0b3663ebd Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Thu, 21 Nov 2013 02:19:15 -0600 Subject: [PATCH] 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. --- code/game/g_client.c | 2 +- code/game/g_combat.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/code/game/g_client.c b/code/game/g_client.c index 737707cd..ee88fac5 100644 --- a/code/game/g_client.c +++ b/code/game/g_client.c @@ -426,7 +426,7 @@ void CopyToBodyQue( gentity_t *ent ) { body->s.eFlags |= EF_KAMIKAZE; // 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]; if (!e->inuse) continue; diff --git a/code/game/g_combat.c b/code/game/g_combat.c index ed0de7f2..2fbd3170 100644 --- a/code/game/g_combat.c +++ b/code/game/g_combat.c @@ -241,7 +241,7 @@ void GibEntity( gentity_t *self, int killer ) { //if this entity still has kamikaze if (self->s.eFlags & EF_KAMIKAZE) { // 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]; if (!ent->inuse) continue;