From 6d1f4f06debe42f4a862acdfe03302e395f6f66e Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 9 Jul 2017 15:37:42 +0200 Subject: [PATCH 1/3] BUG 2256: kill the FFL_NEWID flag --- src/kernel/faction.c | 1 - src/kernel/faction.h | 19 +++++++++---------- src/renumber.c | 4 ---- 3 files changed, 9 insertions(+), 15 deletions(-) diff --git a/src/kernel/faction.c b/src/kernel/faction.c index ae60ce439..d8d7f6f1c 100755 --- a/src/kernel/faction.c +++ b/src/kernel/faction.c @@ -497,7 +497,6 @@ void renumber_faction(faction * f, int no) funhash(f); f->no = no; fhash(f); - fset(f, FFL_NEWID); } void update_interval(struct faction *f, struct region *r) diff --git a/src/kernel/faction.h b/src/kernel/faction.h index e0cd893a1..64832053b 100644 --- a/src/kernel/faction.h +++ b/src/kernel/faction.h @@ -36,21 +36,20 @@ extern "C" { struct selist; /* faction flags */ -#define FFL_NEWID (1<<0) /* Die Partei hat bereits einmal ihre no gewechselt */ +#define FFL_NOAID (1<<0) /* Hilfsflag Kampf */ #define FFL_ISNEW (1<<1) #define FFL_PWMSG (1<<2) /* received a "new password" message */ #define FFL_QUIT (1<<3) #define FFL_CURSED (1<<4) /* you're going to have a bad time */ #define FFL_DEFENDER (1<<10) -#define FFL_NOAID (1<<21) /* Hilfsflag Kampf */ -#define FFL_SELECT (1<<22) /* ehemals f->dh, u->dh, r->dh, etc... */ -#define FFL_MARK (1<<23) /* f�r markierende algorithmen, die das - * hinterher auch wieder l�schen m�ssen! - * (FFL_SELECT muss man vorher initialisieren, - * FL_MARK hinterher l�schen) */ -#define FFL_NOIDLEOUT (1<<24) /* Partei stirbt nicht an NMRs */ -#define FFL_NPC (1<<25) /* eine Partei mit Monstern */ -#define FFL_SAVEMASK (FFL_DEFENDER|FFL_NEWID|FFL_NPC|FFL_NOIDLEOUT|FFL_CURSED) +#define FFL_SELECT (1<<22) /* ehemals f->dh, u->dh, r->dh, etc... */ +#define FFL_MARK (1<<23) /* fuer markierende algorithmen, die das + * hinterher auch wieder loeschen muessen! + * (FFL_SELECT muss man vorher initialisieren, + * FL_MARK hinterher loeschen) */ +#define FFL_NOIDLEOUT (1<<24) /* Partei stirbt nicht an NMRs */ +#define FFL_NPC (1<<25) /* eine Partei mit Monstern */ +#define FFL_SAVEMASK (FFL_DEFENDER|FFL_NPC|FFL_NOIDLEOUT|FFL_CURSED) typedef struct faction { struct faction *next; diff --git a/src/renumber.c b/src/renumber.c index de2b5a490..30769403f 100644 --- a/src/renumber.c +++ b/src/renumber.c @@ -40,10 +40,6 @@ void renumber_factions(void) if (!a) continue; want = a->data.i; - if (fval(f, FFL_NEWID)) { - ADDMSG(&f->msgs, msg_message("renumber_twice", "id", want)); - continue; - } if (!faction_id_is_unused(want)) { a_remove(&f->attribs, a); ADDMSG(&f->msgs, msg_message("renumber_inuse", "id", want)); From 518db87015c8c19356ca9d2c56acf814e493710f Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 9 Jul 2017 15:41:11 +0200 Subject: [PATCH 2/3] eliminate unused message --- res/core/messages.xml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/res/core/messages.xml b/res/core/messages.xml index 5bb36e345..006abd685 100644 --- a/res/core/messages.xml +++ b/res/core/messages.xml @@ -8001,14 +8001,6 @@ "$unit($unit) tried but failed to send $unit($target) to another world." - - - - - "NUMMER PARTEI $int36($id): Die Partei kann nicht mehr als einmal ihre Nummer wecheln." - "NUMBER FACTION $int36($id): Your faction can only change its number once." - - From de9d73bd5a035b511275a7b5af323acf520ae4db Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 9 Jul 2017 15:43:37 +0200 Subject: [PATCH 3/3] fix test to match new flag values --- scripts/tests/common.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/tests/common.lua b/scripts/tests/common.lua index 936d2a79b..2f10b3e8a 100644 --- a/scripts/tests/common.lua +++ b/scripts/tests/common.lua @@ -51,7 +51,7 @@ function test_flags() local f = create_faction('halfling') local u = unit.create(f, r, 1) local no = itoa36(f.id) - local flags = 50332673 + local flags = 50332672 f.flags = flags eressea.write_game("test.dat")