From: cloudwalk Date: Thu, 17 Sep 2020 12:36:53 +0000 (+0000) Subject: com_ents4: Fix possible logic bug with two for loops X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=1796feda0fb1d6b2764394a01a645ef1bcc916bf;p=xonotic%2Fdarkplaces.git com_ents4: Fix possible logic bug with two for loops This is very likely what was originally intended as the second loop would be resetting i, which the first loop is already iterating... git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12931 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/com_ents4.c b/com_ents4.c index f415f68c..67bfba09 100644 --- a/com_ents4.c +++ b/com_ents4.c @@ -80,12 +80,10 @@ int EntityFrame4_AckFrame(entityframe4_database_t *d, int framenum, int servermo // reset reference, but leave commits alone d->referenceframenum = -1; for (i = 0;i < d->maxreferenceentities;i++) - { d->referenceentity[i] = defaultstate; // if this is the server, remove commits - for (i = 0, commit = d->commit;i < MAX_ENTITY_HISTORY;i++, commit++) - commit->numentities = 0; - } + for (i = 0, commit = d->commit;i < MAX_ENTITY_HISTORY;i++, commit++) + commit->numentities = 0; found = true; } else if (d->referenceframenum == framenum)