From 72b8a79fc9ea5c3bfcbeb26a1e0309c18c80c3c4 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Tue, 27 May 2003 22:12:54 +0000 Subject: [PATCH] bug in alliance-scoring --- src/common/modules/score.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/common/modules/score.c b/src/common/modules/score.c index 0daebac6c..924af8f72 100644 --- a/src/common/modules/score.c +++ b/src/common/modules/score.c @@ -282,24 +282,24 @@ score(void) for (a = alliances; a; a = a->next) { int alliance_score = 0, alliance_number = 0, alliance_factions = 0; - int grails = 0; + int grails = 0; for (f = factions; f; f = f->next) { if(f->alliance && f->alliance->id == a->id) { alliance_factions++; alliance_score += f->score; alliance_number += f->number; + if (token!=NULL) { + unit * u = f->units; + while (u!=NULL) { + item ** iitem = i_find(&u->items, token); + if (iitem!=NULL && *iitem!=NULL) { + grails += (*iitem)->number; + } + u=u->nextF; + } + } } - if (token!=NULL) { - unit * u = f->units; - while (u!=NULL) { - item ** iitem = i_find(&u->items, token); - if (iitem!=NULL && *iitem!=NULL) { - grails += (*iitem)->number; - } - u=u->nextF; - } - } } fprintf(scoreFP, "%d:%d:%d:%d", a->id, alliance_factions, alliance_number, alliance_score);