diff --git a/src/common/gamecode/laws.c b/src/common/gamecode/laws.c index b1b7ff8f7..8c7785fcd 100644 --- a/src/common/gamecode/laws.c +++ b/src/common/gamecode/laws.c @@ -3411,15 +3411,15 @@ new_units (void) int g, alias; order ** newordersp; - if (checkunitnumber(u->faction, 1) == false) { - if (global.unitsperalliance == false) { - ADDMSG(&u->faction->msgs, msg_message("too_many_units_in_faction", - "command unit region allowed", - makeord, u, r, maxunits(u->faction))); + if (!checkunitnumber(u->faction, 1)) { + if (global.unitsperalliance) { + ADDMSG(&u->faction->msgs, msg_message("too_many_units_in_alliance", + "command unit region allowed", + makeord, u, r, maxunits(u->faction))); } else { - ADDMSG(&u->faction->msgs, msg_message("too_many_units_in_alliance", - "command unit region allowed", - makeord, u, r, maxunits(u->faction))); + ADDMSG(&u->faction->msgs, msg_message("too_many_units_in_faction", + "command unit region allowed", + makeord, u, r, maxunits(u->faction))); } ordp = &makeord->next; diff --git a/src/common/gamecode/monster.c b/src/common/gamecode/monster.c index 1bb4eef1d..6ded2eb53 100644 --- a/src/common/gamecode/monster.c +++ b/src/common/gamecode/monster.c @@ -1131,7 +1131,7 @@ spawn_undead(void) for (r = regions; r; r = r->next) { int unburied = deathcount(r); - if(is_cursed(r->attribs, C_HOLYGROUND, 0)) continue; + if (is_cursed(r->attribs, C_HOLYGROUND, 0)) continue; /* Chance 0.1% * chaosfactor */ if (r->land && unburied > r->land->peasants / 20 && rng_int() % 10000 < (100 + 100 * chaosfactor(r))) { diff --git a/src/common/kernel/faction.c b/src/common/kernel/faction.c index e3fdbaf01..67e9dccf3 100644 --- a/src/common/kernel/faction.c +++ b/src/common/kernel/faction.c @@ -126,7 +126,7 @@ addfaction(const char *email, const char * password, f->locale = loc; f->subscription = subscription; - f->options = Pow(O_REPORT) | Pow(O_ZUGVORLAGE) | Pow(O_SILBERPOOL) | Pow(O_COMPUTER) | Pow(O_COMPRESS) | Pow(O_ADRESSEN) | Pow(O_STATISTICS); + f->options = want(O_REPORT) | want(O_ZUGVORLAGE) | want(O_SILBERPOOL) | want(O_COMPUTER) | want(O_COMPRESS) | want(O_ADRESSEN) | want(O_STATISTICS); f->no = unused_faction_id(); addlist(&factions, f); diff --git a/src/common/kernel/reports.c b/src/common/kernel/reports.c index eae0832ce..eebc71653 100644 --- a/src/common/kernel/reports.c +++ b/src/common/kernel/reports.c @@ -718,7 +718,7 @@ spskill(char * buffer, size_t size, const struct locale * lang, const struct uni size -= rsize; bufp += rsize; - if(u->faction->options & Pow(O_SHOWSKCHANGE)) { + if (u->faction->options & want(O_SHOWSKCHANGE)) { skill *skill = get_skill(u, sk); int oldeff = 0; int diff; diff --git a/src/common/kernel/save.c b/src/common/kernel/save.c index 1fb98c32a..b050c0cfb 100644 --- a/src/common/kernel/save.c +++ b/src/common/kernel/save.c @@ -1002,10 +1002,10 @@ readunit(FILE * F) u_setfaction(u, findfaction(MONSTER_FACTION)); set_number(u, 0); } - if (playerrace(u->race)) { - u->faction->no_units++; - } - set_number(u, number); + + if (count_unit(u)) u->faction->no_units++; + + set_number(u, number); u->building = findbuilding(rid(F)); u->ship = findship(rid(F)); @@ -1561,9 +1561,9 @@ readfaction(FILE * F) i = f->options = ri(F); - if ((i & ((1<no!=MONSTER_FACTION) { + if ((i & (want(O_REPORT)|want(O_COMPUTER)))==0 && f->no!=MONSTER_FACTION) { /* Kein Report eingestellt, Fehler */ - f->options = f->options | Pow(O_REPORT) | Pow(O_ZUGVORLAGE); + f->options = f->options | want(O_REPORT) | want(O_ZUGVORLAGE); } if (global.data_version < TYPES_VERSION) { @@ -1650,7 +1650,7 @@ writefaction(FILE * F, const faction * f) wi(F, ur->y); } wnl(F); - wi(F, f->options & ~Pow(O_DEBUG)); + wi(F, f->options & ~want(O_DEBUG)); wnl(F); for (sf = f->allies; sf; sf = sf->next) { diff --git a/src/common/kernel/unit.c b/src/common/kernel/unit.c index 7a4360de0..8faeb91e5 100644 --- a/src/common/kernel/unit.c +++ b/src/common/kernel/unit.c @@ -904,9 +904,7 @@ u_setfaction(unit * u, faction * f) if (u->faction) { unit ** iunit; set_number(u, 0); - if (playerrace(u->race)) { - --u->faction->no_units; - } + --u->faction->no_units; join_group(u, NULL); free_orders(&u->orders); set_order(&u->thisorder, NULL); @@ -932,9 +930,7 @@ u_setfaction(unit * u, faction * f) if (u->region) update_interval(f, u->region); if (cnt && f) { set_number(u, cnt); - if (playerrace(u->race)) { - ++f->no_units; - } + ++f->no_units; } } diff --git a/src/mapper/mapper.c b/src/mapper/mapper.c index c210d36ed..8a8707e72 100644 --- a/src/mapper/mapper.c +++ b/src/mapper/mapper.c @@ -1520,7 +1520,7 @@ makemonsters(void) f->locale=default_locale; factions=f; - f->options = Pow(O_REPORT); + f->options = want(O_REPORT); f->no=MONSTER_FACTION; f->subscription = 0; f->name=strdup("Monster");