From 2e1537cb2cb1c5028bba19a29bb4e9d58969c4a3 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Tue, 27 May 2003 21:51:36 +0000 Subject: [PATCH] bugfix mapper, conquest rules --- src/common/kernel/alliance.c | 1 + src/common/kernel/building.c | 1 - src/common/modules/alliance.c | 1 + src/common/modules/score.c | 2 +- src/mapper/map_partei.c | 2 +- 5 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/common/kernel/alliance.c b/src/common/kernel/alliance.c index 6535cd707..462393c6f 100644 --- a/src/common/kernel/alliance.c +++ b/src/common/kernel/alliance.c @@ -243,6 +243,7 @@ alliancevictory(void) const struct building_type * btype = bt_find("stronghold"); region * r = regions; alliance * al = alliances; + if (btype==NULL) return; while (r!=NULL) { building * b = r->buildings; while (b!=NULL) { diff --git a/src/common/kernel/building.c b/src/common/kernel/building.c index 9cbae958b..6c8ca40de 100644 --- a/src/common/kernel/building.c +++ b/src/common/kernel/building.c @@ -67,7 +67,6 @@ bt_find(const char* name) btl = buildingtypes; while (btl && strncasecmp(btl->type->_name, name, strlen(name))) btl = btl->next; } - assert(btl); return btl?btl->type:NULL; } diff --git a/src/common/modules/alliance.c b/src/common/modules/alliance.c index 6535cd707..462393c6f 100644 --- a/src/common/modules/alliance.c +++ b/src/common/modules/alliance.c @@ -243,6 +243,7 @@ alliancevictory(void) const struct building_type * btype = bt_find("stronghold"); region * r = regions; alliance * al = alliances; + if (btype==NULL) return; while (r!=NULL) { building * b = r->buildings; while (b!=NULL) { diff --git a/src/common/modules/score.c b/src/common/modules/score.c index 49251d3d8..0daebac6c 100644 --- a/src/common/modules/score.c +++ b/src/common/modules/score.c @@ -293,7 +293,7 @@ score(void) if (token!=NULL) { unit * u = f->units; while (u!=NULL) { - const item ** iitem = i_find(&u->items, token); + item ** iitem = i_find(&u->items, token); if (iitem!=NULL && *iitem!=NULL) { grails += (*iitem)->number; } diff --git a/src/mapper/map_partei.c b/src/mapper/map_partei.c index 0a0ae2973..838c8848c 100644 --- a/src/mapper/map_partei.c +++ b/src/mapper/map_partei.c @@ -322,7 +322,7 @@ read_newfactions(const char * filename) #ifdef ALLIANCES int alliance; /* email;race;locale;startbonus;subscription;alliance */ - if (fscanf(F, "%s %s %s %d %s %d %d", email, race, lang, &bonus, &subscription, password, &alliance)<=0) break; + if (fscanf(F, "%s %s %s %d %d %s %d", email, race, lang, &bonus, &subscription, password, &alliance)<=0) break; #else /* email;race;locale;startbonus;subscription */ if (fscanf(F, "%s %s %s %d %d %s", email, race, lang, &bonus, &subscription, password)<=0) break;