From f30a7848a551843cdc7f94afb88c6826023c29fd Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sat, 24 Aug 2019 12:14:43 +0200 Subject: [PATCH 1/3] rule_give is crufty, do not involve it in destroyfaction --- src/kernel/config.c | 1 + src/kernel/unit.c | 10 ---------- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/src/kernel/config.c b/src/kernel/config.c index 4075621f3..9858e2f8b 100644 --- a/src/kernel/config.c +++ b/src/kernel/config.c @@ -516,6 +516,7 @@ int rule_give(void) static int config; static int rule; if (config_changed(&config)) { + /* TODO: No game uses this. Eliminate? */ rule = config_get_int("rules.give.flags", GIVE_DEFAULT); } return rule; diff --git a/src/kernel/unit.c b/src/kernel/unit.c index 9933899ed..f8e737587 100644 --- a/src/kernel/unit.c +++ b/src/kernel/unit.c @@ -221,19 +221,9 @@ int gift_items(unit * u, int flags) region *r = u->region; item **itm_p = &u->items; int retval = 0; - int rule = rule_give(); assert(u->region); - if ((rule & GIVE_ONDEATH) == 0 || !u->faction || (u->faction->flags & FFL_QUIT) == 0) { - if ((rule & GIVE_ALLITEMS) == 0 && (flags & GIFT_FRIENDS)) - flags -= GIFT_FRIENDS; - if ((rule & GIVE_PEASANTS) == 0 && (flags & GIFT_PEASANTS)) - flags -= GIFT_PEASANTS; - if ((rule & GIVE_SELF) == 0 && (flags & GIFT_SELF)) - flags -= GIFT_SELF; - } - if (u->items == NULL || fval(u_race(u), RCF_ILLUSIONARY)) return 0; From bfd29a4d172d7c3f2bf072bc852dd411412cb0b9 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Fri, 13 Sep 2019 22:03:40 +0200 Subject: [PATCH 2/3] clibs update --- clibs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clibs b/clibs index 1854780fe..f8969f44d 160000 --- a/clibs +++ b/clibs @@ -1 +1 @@ -Subproject commit 1854780fe3073e491775836c22f709668b1fff62 +Subproject commit f8969f44de1ec413cfee82b23c9f4b3c32d49b56 From 434aa15b9afd4df474ba7e0b1d0428215faa608c Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sat, 14 Sep 2019 21:51:13 +0200 Subject: [PATCH 3/3] factions that idle out gift their stuff to friends --- src/kernel/faction.c | 5 ++--- src/spells/combatspells.c | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/kernel/faction.c b/src/kernel/faction.c index b6bd02659..882c1333a 100755 --- a/src/kernel/faction.c +++ b/src/kernel/faction.c @@ -408,9 +408,6 @@ void destroyfaction(faction ** fp) f->next = dead_factions; dead_factions = f; - fset(f, FFL_QUIT); - f->_alive = false; - if (f->spellbook) { spellbook_clear(f->spellbook); free(f->spellbook); @@ -463,6 +460,8 @@ void destroyfaction(faction ** fp) setalliance(f, NULL); } + fset(f, FFL_QUIT); + f->_alive = false; funhash(f); /* units of other factions that were disguised as this faction diff --git a/src/spells/combatspells.c b/src/spells/combatspells.c index 51059b546..f4b8b6954 100644 --- a/src/spells/combatspells.c +++ b/src/spells/combatspells.c @@ -952,8 +952,7 @@ int sp_hero(struct castorder * co) } } - m = - msg_message("cast_hero_effect", "mage spell amount", fi->unit, sp, targets); + m = msg_message("cast_hero_effect", "mage spell amount", fi->unit, sp, targets); message_all(b, m); msg_release(m);