From 072f927d5b46309b8675c014a1be8adf616b8e47 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sat, 5 Jul 2014 19:29:12 -0700 Subject: [PATCH] replace RCF_CANSTEAL with RCF_NOSTEAL for less confusing default behavior. --- src/economy.c | 2 +- src/kernel/jsonconf.c | 4 ++-- src/kernel/jsonconf.test.c | 2 +- src/kernel/race.h | 10 +++++----- src/kernel/xmlreader.c | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/economy.c b/src/economy.c index 79ca4022c..1b6a4136b 100644 --- a/src/economy.c +++ b/src/economy.c @@ -2760,7 +2760,7 @@ static void steal_cmd(unit * u, struct order *ord, request ** stealorders) assert(skill_enabled(SK_PERCEPTION) && skill_enabled(SK_STEALTH)); - if (!fval(u_race(u), RCF_CANSTEAL)) { + if (fval(u_race(u), RCF_NOSTEAL)) { ADDMSG(&u->faction->msgs, msg_feedback(u, ord, "race_nosteal", "race", u_race(u))); return; diff --git a/src/kernel/jsonconf.c b/src/kernel/jsonconf.c index 7ed042666..ef771f8ac 100644 --- a/src/kernel/jsonconf.c +++ b/src/kernel/jsonconf.c @@ -326,8 +326,8 @@ static void json_ship(cJSON *json, ship_type *st) { static void json_race(cJSON *json, race *rc) { cJSON *child; const char *flags[] = { - "playerrace", "killpeasants", "scarepeasants", - "cansteal", "moverandom", "cannotmove", + "npc", "killpeasants", "scarepeasants", + "nosteal", "moverandom", "cannotmove", "learn", "fly", "swim", "walk", "nolearn", "noteach", "horse", "desert", "illusionary", "absorbpeasants", "noheal", diff --git a/src/kernel/jsonconf.test.c b/src/kernel/jsonconf.test.c index 3d7ffbbeb..ad525ef33 100644 --- a/src/kernel/jsonconf.test.c +++ b/src/kernel/jsonconf.test.c @@ -34,7 +34,7 @@ static void check_flag(CuTest *tc, const char *name, int flag) { static void test_flags(CuTest *tc) { check_flag(tc, "npc", RCF_NPC); check_flag(tc, "scarepeasants", RCF_SCAREPEASANTS); - check_flag(tc, "cansteal", RCF_CANSTEAL); + check_flag(tc, "nosteal", RCF_NOSTEAL); check_flag(tc, "noheal", RCF_NOHEAL); check_flag(tc, "undead", RCF_UNDEAD); check_flag(tc, "dragon", RCF_DRAGON); diff --git a/src/kernel/race.h b/src/kernel/race.h index 3834dbfb7..62793bb12 100644 --- a/src/kernel/race.h +++ b/src/kernel/race.h @@ -183,11 +183,11 @@ extern "C" { const struct weapon_type *); void free_races(void); -/* Flags */ -#define RCF_NPC (1<<0) /* can be played by a player. */ -#define RCF_KILLPEASANTS (1<<1) /* Töten Bauern. Dämonen werden nicht über dieses Flag, sondern in randenc() behandelt. */ -#define RCF_SCAREPEASANTS (1<<2) -#define RCF_CANSTEAL (1<<3) +/* Flags. Do not reorder these without changing json_race() in jsonconf.c */ +#define RCF_NPC (1<<0) /* cannot be the race for a player faction (and other limits?) */ +#define RCF_KILLPEASANTS (1<<1) /* a monster that eats peasants */ +#define RCF_SCAREPEASANTS (1<<2) /* a monster that scares peasants out of the hex */ +#define RCF_NOSTEAL (1<<3) /* this race has high stealth, but is not allowed to steal */ #define RCF_MOVERANDOM (1<<4) #define RCF_CANNOTMOVE (1<<5) #define RCF_LEARN (1<<6) /* Lernt automatisch wenn struct faction == 0 */ diff --git a/src/kernel/xmlreader.c b/src/kernel/xmlreader.c index bc0bcd50e..3832c9bb1 100644 --- a/src/kernel/xmlreader.c +++ b/src/kernel/xmlreader.c @@ -1672,8 +1672,8 @@ static int parse_races(xmlDocPtr doc) rc->flags |= RCF_NPC; if (xml_bvalue(node, "scarepeasants", false)) rc->flags |= RCF_SCAREPEASANTS; - if (xml_bvalue(node, "cansteal", true)) - rc->flags |= RCF_CANSTEAL; + if (!xml_bvalue(node, "cansteal", true)) + rc->flags |= RCF_NOSTEAL; if (xml_bvalue(node, "cansail", true)) rc->flags |= RCF_CANSAIL; if (xml_bvalue(node, "cannotmove", false))