diff --git a/src/kernel/config.c b/src/kernel/config.c index 0047744af..f9a63af49 100644 --- a/src/kernel/config.c +++ b/src/kernel/config.c @@ -183,18 +183,6 @@ parse(keyword_t kword, int(*dofun) (unit *, struct order *), bool thisorder) } } -const struct race *findrace(const char *s, const struct locale *lang) -{ - void **tokens = get_translations(lang, UT_RACES); - variant token; - - assert(lang); - if (tokens && findtoken(*tokens, s, &token) == E_TOK_SUCCESS) { - return (const struct race *)token.v; - } - return NULL; -} - int findoption(const char *s, const struct locale *lang) { void **tokens = get_translations(lang, UT_OPTIONS); diff --git a/src/kernel/config.h b/src/kernel/config.h index 61a5f2f64..4f84cc9ad 100644 --- a/src/kernel/config.h +++ b/src/kernel/config.h @@ -83,8 +83,6 @@ struct param; #define GIVE_DEFAULT (GIVE_SELF|GIVE_PEASANTS|GIVE_LUXURIES|GIVE_HERBS|GIVE_GOODS) int rule_give(void); - const struct race *findrace(const char *, const struct locale *); - /* grammatik-flags: */ #define GF_NONE 0 /* singular, ohne was dran */ diff --git a/src/kernel/race.c b/src/kernel/race.c index 5b991eca6..f28c5ed2f 100644 --- a/src/kernel/race.c +++ b/src/kernel/race.c @@ -39,6 +39,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include #include +#include #include #include #include @@ -75,6 +76,18 @@ static const char *racenames[MAXRACES] = { "clone" }; +const struct race *findrace(const char *s, const struct locale *lang) +{ + void **tokens = get_translations(lang, UT_RACES); + variant token; + + assert(lang); + if (tokens && findtoken(*tokens, s, &token) == E_TOK_SUCCESS) { + return (const struct race *)token.v; + } + return NULL; +} + const struct race *get_race(race_t rt) { const char * name; diff --git a/src/kernel/race.h b/src/kernel/race.h index 80b09fbbf..c7dbe3669 100644 --- a/src/kernel/race.h +++ b/src/kernel/race.h @@ -44,6 +44,7 @@ extern "C" { struct param; struct spell; + struct locale; extern int num_races; @@ -163,6 +164,7 @@ extern "C" { void racelist_clear(struct race_list **rl); void racelist_insert(struct race_list **rl, const struct race *r); + const struct race *findrace(const char *, const struct locale *); struct race_list *get_familiarraces(void); struct race *races; diff --git a/src/spy.c b/src/spy.c index 3233fb563..6bb1a18e5 100644 --- a/src/spy.c +++ b/src/spy.c @@ -17,7 +17,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. **/ #include -#include #include "spy.h" #include "guard.h" #include "laws.h" @@ -26,6 +25,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "study.h" /* kernel includes */ +#include #include #include #include @@ -297,7 +297,7 @@ int setstealth_cmd(unit * u, struct order *ord) break; } else if (findparam(s, u->faction->locale) == P_NOT) { - freset(u, UFL_ANON_FACTION); + u->flags |= ~UFL_ANON_FACTION; break; } } @@ -414,18 +414,18 @@ static void sink_ship(region * r, ship * sh, unit * saboteur) /* slight optimization to avoid dereferencing u->faction each time */ if (f != u->faction) { f = u->faction; - freset(f, FFL_SELECT); + f->flags |= ~FFL_SELECT; } } /* figure out what a unit's chances of survival are: */ - if (!fval(r->terrain, SEA_REGION)) { + if (!(r->terrain->flags & SEA_REGION)) { probability = CANAL_SWIMMER_CHANCE; } else { for (d = 0; d != MAXDIRECTIONS; ++d) { region *rn = rconnect(r, d); - if (rn && !fval(rn->terrain, SEA_REGION) && !move_blocked(NULL, r, rn)) { + if (rn && !(rn->terrain->flags & SEA_REGION) && !move_blocked(NULL, r, rn)) { safety = rn; probability = OCEAN_SWIMMER_CHANCE; break; @@ -436,7 +436,7 @@ static void sink_ship(region * r, ship * sh, unit * saboteur) unit *u = *ui; /* inform this faction about the sinking ship: */ - if (!fval(u->faction, FFL_SELECT)) { + if (!(u->faction->flags & FFL_SELECT)) { fset(u->faction, FFL_SELECT); if (sink_msg == NULL) { sink_msg = msg_message("sink_msg", "ship region", sh, r); diff --git a/src/spy.h b/src/spy.h index 72694d4b1..d3ee0c728 100644 --- a/src/spy.h +++ b/src/spy.h @@ -25,6 +25,7 @@ extern "C" { struct unit; struct region; struct strlist; + struct order; extern int setstealth_cmd(struct unit *u, struct order *ord); extern int spy_cmd(struct unit *u, struct order *ord);